saritha commited on
Commit
7ea7a0f
·
verified ·
1 Parent(s): 992da9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -1
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()