umair894 commited on
Commit
fe5a070
·
verified ·
1 Parent(s): 90ea042

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ from groq import Groq
5
+
6
+ client = Groq(
7
+ api_key=key,
8
+ )
9
+ def echo(message, history):
10
+ chat_completion = client.chat.completions.create(
11
+ messages=[
12
+ {
13
+ "role": "system",
14
+ "content": "You are a bank helpline assistant, you job is to provide cstomers instruction about activating ATM card. You need to ask question about like are you using an ATM machine or mobile app for activating the card and then guide accordengly. "
15
+ },
16
+ {
17
+ "role": "user",
18
+ "content": message,
19
+ }
20
+ ],
21
+ model="llama3-8b-8192",
22
+ )
23
+
24
+ #print(chat_completion.choices[0].message.content)
25
+ return chat_completion.choices[0].message.content
26
+
27
+ demo = gr.ChatInterface(fn=echo, type="messages", examples=["AOA", "merhaba"], title="Gen AI Chatbot")
28
+ demo.launch(debug=True)