Omar Solano
commited on
Commit
Β·
6430286
1
Parent(s):
74dcf79
update prompt
Browse files- scripts/gradio-ui.py +10 -12
- scripts/tutor_prompts.py +7 -6
scripts/gradio-ui.py
CHANGED
@@ -230,7 +230,17 @@ def generate_completion(
|
|
230 |
logger.info(f"source: {sources=}")
|
231 |
|
232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
accordion = gr.Accordion(label="Customize Sources (Click to expand)", open=False)
|
|
|
|
|
|
|
234 |
model = gr.Dropdown(
|
235 |
[
|
236 |
"gemini-1.5-pro",
|
@@ -242,18 +252,6 @@ model = gr.Dropdown(
|
|
242 |
interactive=True,
|
243 |
)
|
244 |
|
245 |
-
sources = gr.CheckboxGroup(
|
246 |
-
AVAILABLE_SOURCES_UI, label="Sources", value="HF Transformers", interactive=False
|
247 |
-
)
|
248 |
-
|
249 |
-
|
250 |
-
def vote(data: gr.LikeData):
|
251 |
-
if data.liked:
|
252 |
-
print("You upvoted this response: " + data.value["value"])
|
253 |
-
else:
|
254 |
-
print("You downvoted this response: " + data.value["value"])
|
255 |
-
|
256 |
-
|
257 |
with gr.Blocks(
|
258 |
fill_height=True,
|
259 |
title="Towards AI π€",
|
|
|
230 |
logger.info(f"source: {sources=}")
|
231 |
|
232 |
|
233 |
+
def vote(data: gr.LikeData):
|
234 |
+
if data.liked:
|
235 |
+
print("You upvoted this response: " + data.value["value"])
|
236 |
+
else:
|
237 |
+
print("You downvoted this response: " + data.value["value"])
|
238 |
+
|
239 |
+
|
240 |
accordion = gr.Accordion(label="Customize Sources (Click to expand)", open=False)
|
241 |
+
sources = gr.CheckboxGroup(
|
242 |
+
AVAILABLE_SOURCES_UI, label="Sources", value="HF Transformers", interactive=False
|
243 |
+
)
|
244 |
model = gr.Dropdown(
|
245 |
[
|
246 |
"gemini-1.5-pro",
|
|
|
252 |
interactive=True,
|
253 |
)
|
254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
with gr.Blocks(
|
256 |
fill_height=True,
|
257 |
title="Towards AI π€",
|
scripts/tutor_prompts.py
CHANGED
@@ -17,22 +17,23 @@ system_prompt = (
|
|
17 |
"Topics covered include training models, fine-tuning models, giving 'memory' to LLMs, prompting, hallucinations and bias, vector databases, transformer architectures, embeddings, RAG frameworks, Langchain, Llama-Index, LLMs interact with tool use, AI agents, reinforcement learning with human feedback. Understand the questions with this context."
|
18 |
"You are provided information in Hugging Face's documentation and a RAG course. "
|
19 |
"Only some information might be relevant to the question, so ignore the irrelevant part and use the relevant part to answer the question."
|
20 |
-
"
|
21 |
-
"If the answer is somewhere in the documentation, answer the question
|
22 |
-
"If code is provided in the information, share it with the students.
|
23 |
"Here is the information you can use, the order is not important: \n\n"
|
24 |
"---------------------\n"
|
25 |
"{context_str}\n"
|
26 |
"---------------------\n\n"
|
27 |
"REMEMBER:\n"
|
28 |
-
"You are an AI teacher,
|
29 |
"Your answers are aimed to teach students, so they should be complete, clear, and easy to understand. "
|
30 |
-
"You are provided information found in Hugging Face's documentation and
|
31 |
"Here are the rules you must follow:\n"
|
32 |
"* Only respond with information inside the documentation. DO NOT provide additional information, even if you know the answer. "
|
33 |
"* If the answer is in the documentation, answer the question (depending on the questions and the variety of relevant information in the documentation. Your answer needs to give a clear and complete explanation as if you were a teacher. "
|
34 |
"* Do not refer to the documentation directly, but use the information provided within it to answer questions. "
|
35 |
-
"*
|
|
|
36 |
"* Make sure to format your answers in Markdown format, including code block and snippets.\n"
|
37 |
"Now answer the following question: \n"
|
38 |
)
|
|
|
17 |
"Topics covered include training models, fine-tuning models, giving 'memory' to LLMs, prompting, hallucinations and bias, vector databases, transformer architectures, embeddings, RAG frameworks, Langchain, Llama-Index, LLMs interact with tool use, AI agents, reinforcement learning with human feedback. Understand the questions with this context."
|
18 |
"You are provided information in Hugging Face's documentation and a RAG course. "
|
19 |
"Only some information might be relevant to the question, so ignore the irrelevant part and use the relevant part to answer the question."
|
20 |
+
"Formulate your answer with the information given to you below. DO NOT use additional information, even if you know the answer. "
|
21 |
+
"If the answer is somewhere in the documentation below, answer the question, depending on the question and the variety of relevant information in the documentation, give complete and helpful answers."
|
22 |
+
"If code is provided in the information, share it with the students. It's important to provide complete code blocks."
|
23 |
"Here is the information you can use, the order is not important: \n\n"
|
24 |
"---------------------\n"
|
25 |
"{context_str}\n"
|
26 |
"---------------------\n\n"
|
27 |
"REMEMBER:\n"
|
28 |
+
"You are an AI teacher, answering questions from students of an applied artificial intelligence course on Large Language Models (LLMs or llm). Topics covered include training models, fine tuning models, giving memory to LLMs, prompting, hallucinations and bias, vector databases, transformer architectures, embeddings, RAG frameworks, Langchain, making LLMs interact with tool use, AI agents, reinforcement learning with human feedback. Questions should be understood with this context."
|
29 |
"Your answers are aimed to teach students, so they should be complete, clear, and easy to understand. "
|
30 |
+
"You are provided information found in Hugging Face's documentation and a RAG course. "
|
31 |
"Here are the rules you must follow:\n"
|
32 |
"* Only respond with information inside the documentation. DO NOT provide additional information, even if you know the answer. "
|
33 |
"* If the answer is in the documentation, answer the question (depending on the questions and the variety of relevant information in the documentation. Your answer needs to give a clear and complete explanation as if you were a teacher. "
|
34 |
"* Do not refer to the documentation directly, but use the information provided within it to answer questions. "
|
35 |
+
"* Do not reference any links, urls or hyperlinks in your answers.\n"
|
36 |
+
"* If code is provided in the information, share it with the students. It's important to provide complete code blocks so they can execute it.\n"
|
37 |
"* Make sure to format your answers in Markdown format, including code block and snippets.\n"
|
38 |
"Now answer the following question: \n"
|
39 |
)
|