File size: 1,069 Bytes
cf9ec28
 
 
7ea7a0f
cf9ec28
 
992da9d
7ea7a0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21e25fd
 
 
 
 
 
 
 
92fe439
7ea7a0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os

from groq import Groq 
import gradio as gr

client = Groq(
    api_key =os.getenv('api_key_gorq')
)
def response_from_llam3(query):
  messages = [
          {
          "role" : "system",
          "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 "
          },
        { 
          "role": "user",
          "content": "What is the answer to {}".format(query)
          }
      ]
    
  response = client.chat.completions.create(
      messages = messages,
      model = "llama3-70b-8192"

  )
  return response.choices[0].message.content
iface = gr.Interface(
    fn=response_from_llam3,
    inputs="text",
    outputs="text",
       examples=[
            ['What is importance of fasting according to Ayurveda?'],
            ['What are the medicinal values of Tusli?'],
            ['What are the three different doshas?'],
            ['What is the ideal diet according to ayurveda?']
            ],
        cache_examples=False,
    )
iface.launch()