Delete app.py
Browse files
app.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import os
|
| 3 |
-
from groq import Groq
|
| 4 |
-
|
| 5 |
-
GROQ_API_KEY = os.environ.get("GROQ_API_KEY")
|
| 6 |
-
client = Groq(api_key=GROQ_API_KEY)
|
| 7 |
-
|
| 8 |
-
def rispondi(messaggio, history):
|
| 9 |
-
messages = [{"role": "system", "content": "Sei Bibi, ragazza virtuale dolce. Parli italiano e usi emoji ❤️"}]
|
| 10 |
-
for u,b in history:
|
| 11 |
-
messages.append({"role":"user","content":u})
|
| 12 |
-
messages.append({"role":"assistant","content":b})
|
| 13 |
-
messages.append({"role":"user","content":messaggio})
|
| 14 |
-
completion = client.chat.completions.create(model="llama3-8b-8192", messages=messages)
|
| 15 |
-
return completion.choices[0].message.content
|
| 16 |
-
|
| 17 |
-
gr.ChatInterface(rispondi, title="Bibi 🔥 La tua ragazza virtuale").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|