Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,14 +10,14 @@ def respond(
|
|
| 10 |
message,
|
| 11 |
history: list[tuple[str, str]],
|
| 12 |
max_tokens=1024,
|
| 13 |
-
temperature=0.
|
| 14 |
top_p=0.95,
|
| 15 |
):
|
| 16 |
# System message defining assistant behavior
|
| 17 |
system_message = {
|
| 18 |
-
"role": "
|
| 19 |
-
"content": f"
|
| 20 |
-
f"Here is about SARATH:```{data}```. You should answer questions based on this information only
|
| 21 |
f"If the question is irreverent to the contex=[about sarath], polity reply the user"
|
| 22 |
}
|
| 23 |
|
|
@@ -33,7 +33,7 @@ def respond(
|
|
| 33 |
# Adding the current user input
|
| 34 |
messages.append({"role": "user", "content": message})
|
| 35 |
|
| 36 |
-
response =
|
| 37 |
|
| 38 |
# Streaming the response from the API
|
| 39 |
for message in client.chat_completion(
|
|
@@ -58,7 +58,13 @@ with gr.Blocks(theme=gr.themes.Ocean(font=[gr.themes.GoogleFont("Roboto Mono")])
|
|
| 58 |
gr.Markdown(data)
|
| 59 |
|
| 60 |
with gr.TabItem("My2.0"):
|
| 61 |
-
gr.ChatInterface(respond
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
if __name__ == "__main__":
|
| 64 |
main.launch(share=True)
|
|
|
|
| 10 |
message,
|
| 11 |
history: list[tuple[str, str]],
|
| 12 |
max_tokens=1024,
|
| 13 |
+
temperature=0.5,
|
| 14 |
top_p=0.95,
|
| 15 |
):
|
| 16 |
# System message defining assistant behavior
|
| 17 |
system_message = {
|
| 18 |
+
"role": "SARATH",
|
| 19 |
+
"content": f"Act and chat as SARATH to thw user question. SARATH is a professional fresher seeking a job pursuing Btech-4-1 and your name is SARATH."
|
| 20 |
+
f"Here is about SARATH:```{data}```. You should answer questions based on this information only."
|
| 21 |
f"If the question is irreverent to the contex=[about sarath], polity reply the user"
|
| 22 |
}
|
| 23 |
|
|
|
|
| 33 |
# Adding the current user input
|
| 34 |
messages.append({"role": "user", "content": message})
|
| 35 |
|
| 36 |
+
response = gr.Markdown("")
|
| 37 |
|
| 38 |
# Streaming the response from the API
|
| 39 |
for message in client.chat_completion(
|
|
|
|
| 58 |
gr.Markdown(data)
|
| 59 |
|
| 60 |
with gr.TabItem("My2.0"):
|
| 61 |
+
gr.ChatInterface(respond,
|
| 62 |
+
chatbot=gr.Chatbot(height=500),
|
| 63 |
+
examples=["Tell me about yourself sarath",
|
| 64 |
+
'Can you walk me through some of your recent projects and explain the role you played in each?',
|
| 65 |
+
"What specific skills do you bring to the table that would benefit our company's AI/ML initiatives?",
|
| 66 |
+
"How do you stay updated with the latest trends and advancements in AI and Machine Learning?" ],
|
| 67 |
+
)
|
| 68 |
|
| 69 |
if __name__ == "__main__":
|
| 70 |
main.launch(share=True)
|