Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,32 @@
|
|
1 |
import os
|
2 |
|
3 |
from groq import Groq
|
|
|
4 |
|
5 |
client = Groq(
|
6 |
api_key =os.getenv('api_key_gorq')
|
7 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
|
3 |
from groq import Groq
|
4 |
+
import gradio as gr
|
5 |
|
6 |
client = Groq(
|
7 |
api_key =os.getenv('api_key_gorq')
|
8 |
+
)
|
9 |
+
def response_from_llam3(query):
|
10 |
+
messages = [
|
11 |
+
{
|
12 |
+
"role" : "system",
|
13 |
+
"content": "You are an helpul Assistant who has plently of Knowledge on Ayur Veda. If the message is Hi or any greeting say namste how can i assist you "
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"role": "user",
|
17 |
+
"content": "What is the answer to {}".format(query)
|
18 |
+
}
|
19 |
+
]
|
20 |
+
|
21 |
+
response = client.chat.completions.create(
|
22 |
+
messages = messages,
|
23 |
+
model = "llama3-70b-8192"
|
24 |
+
|
25 |
+
)
|
26 |
+
return response.choices[0].message.content
|
27 |
+
iface = gr.Interface(
|
28 |
+
fn=response_from_llam3,
|
29 |
+
inputs="text",
|
30 |
+
outputs="text"
|
31 |
+
])
|
32 |
+
iface.launch()
|