- Learn about using different types of prompting styles
- Use OpenAI's API
- Calling Hugging Face and its APIs
- Additional Resources
Use the provided AWS Academy Generative AI Foundations course provided https://awsacademy.instructure.com/courses/129069 and complete the two activities in Module 04 - Using prompts and prompt engineering
- Provide Screen shots of you doing the two labs as evidence.
- Submit your answers under Exercise 1
Look at the LLM Leaderboard - https://artificialanalysis.ai/leaderboards/models
- Where does your favourite LLM rank currently?
- Try out at least two models that you haven't tried before (you will have to do a seperate google search to find these products)
- Run two prompts of your choice
- Submit the model, the prompt and the responses you have got.
Use the following large language models, enabling the reasoning model of the platform and generate a detail report on "How you can use generative AI as a university student to learn subjects like probability and statistics, data base management systems and software engineering"
- https://chat.deepseek.com - Deepthing R1
- https://chat.qwen.ai - Thinking
- https://x.com/i/grok - DeepSearch
In your submission, mention the LLMs used, the report, and a reflection of anything useful you have found, in your opinion which tool produced the best results
- In this lab we will use OpenAI API to develop an application in python
- Create an account at https://www.deeplearning.ai
- Register to the free course at https://learn.deeplearning.ai/courses/chatgpt-building-system
- Select the second activity
- Execute the first code line in Jupiter notebook
- Add the following code and in a codeblock and run
# Define system prompt (initial behavior)
system_prompt = {"role": "system", "content": "You are a helpful assistant with deep knowledge in physics."}
# Define user prompt (specific query)
user_prompt = {"role": "user", "content": "Explain how black holes are formed."}
# Send prompt to API
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[system_prompt, user_prompt]
)
print(response['choices'][0]['message']['content'])
Please see the figure below if you have issues running this
- Copy the codeblock given above again to the next cell and perform the following changes
- Give a System Prompt for a chatbot to behave as an expert event planner
- Give a User Prompt asking for advice how to plan for an event you have to do, maybe your friends Birthday Party, or a Batch Outing
- Tryout a unique System prompt and User Prompt for a problem of your choice.
- Share screen shots and upload the prompts and responses for the above activities
- Create an account in https://huggingface.co
- Select any AI project of your liking under Spaces
- Tryout the AI project and generate the output
- Share screenshots of your usage of the AI project
- Under Models select a Model of your choice to find more details about it
- Create an account in https://colab.research.google.com
- Change Runtime to GPU
- Run the summarization example in a codeblock, here the Hugging Face open model will be downloaded to Google Colab and then it will be exectuted. Because of this it will take some time to run the model for the first time.
from transformers import pipeline
summarizer = pipeline("summarization")
summary = summarizer("""Hugging Face is a pioneering open-source AI platform
that empowers developers, researchers, and organizations to easily access and
deploy cutting-edge machine learning models for natural language processing, computer vision,
and beyond—democratizing AI and accelerating innovation through a collaborative ecosystem of tools,
datasets, and community-driven contributions.""", max_length=20)
print(summary)
- Have a look at a specific summarization model available in HuggingFace - https://huggingface.co/EbanLee/kobart-summary-v3
- Run the summarization for this model given below, here the Hugging Face open model will be downloaded to Google Colab and then it will be exectuted. Because of this it will take some time to run the model for the first time.
from transformers import pipeline
# Use a known summarization model
summarizer = pipeline("summarization", model="EbanLee/kobart-summary-v3")
# Input text to summarize
text = """Hugging Face is a pioneering open-source AI platform
that empowers developers, researchers, and organizations to easily access and
deploy cutting-edge machine learning models for natural language processing, computer vision,
and beyond—democratizing AI and accelerating innovation through a collaborative ecosystem of tools,
datasets, and community-driven contributions."""
# Generate summary
summary = summarizer(text, max_length=20, min_length=5, do_sample=False)
print(summary)
- Select a Natural Language Model of your choice from Hugging Face
- Try your best to see if you can get your selected Model running in Google CoLab. In some instances you will have to install additional python libraries. Some models have on the Right Side called Use this Model, where you can get Google CoLab code that you can try to use.
- Create an Account in Coursera - https://www.coursera.org/
- Register to these three courses
https://www.coursera.org/learn/learning-chatgpt
https://www.coursera.org/learn/prompt-engineering
https://www.coursera.org/learn/learning-how-to-learn - Select a topic from the Prompt Engineering Course given above, and develop your own prompt based on the style given
- Try it out in your favourite LLM
- Share the prompt, output and a screenshot of what you have done
- Go through these courses when you have some free time
- Submit all lab work you have done, including screenshots based on instructions given to you.
(c) Faculty of Computing, SLIIT






