ChatBot_llama / app.py
curiousgeorge1292's picture
Update app.py
f1a815c verified
raw
history blame contribute delete
638 Bytes
import os
import gradio as gr
from groq import Groq
client = Groq(
api_key=os.environ.get("GROQ_API_KEY"),
)
def chat_with_groq(user_input, additional_info=None):
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": user_input,
}
],
model="llama3-8b-8192",
)
return chat_completion.choices[0].message.content
iface = gr.ChatInterface(
fn=chat_with_groq,
title="Chat with Groq",
description="Chat anything with AI powered by Groq",
)
if __name__ == "__main__":
iface.launch(share=True)