Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import gradio as gr
|
|
| 4 |
from groq import Groq
|
| 5 |
|
| 6 |
client = Groq(
|
| 7 |
-
api_key
|
| 8 |
)
|
| 9 |
|
| 10 |
def create_history_messages(history):
|
|
@@ -19,7 +19,7 @@ def generate_response(prompt, history, model, temperature, max_tokens, top_p, se
|
|
| 19 |
|
| 20 |
if seed == 0:
|
| 21 |
seed = random.randint(1, 100000)
|
| 22 |
-
|
| 23 |
stream = client.chat.completions.create(
|
| 24 |
messages=messages,
|
| 25 |
model=model,
|
|
@@ -82,6 +82,8 @@ interface = gr.ChatInterface(
|
|
| 82 |
theme=theme
|
| 83 |
)
|
| 84 |
|
| 85 |
-
|
|
|
|
|
|
|
| 86 |
|
| 87 |
-
|
|
|
|
| 4 |
from groq import Groq
|
| 5 |
|
| 6 |
client = Groq(
|
| 7 |
+
api_key=os.environ.get("Groq_Api_Key")
|
| 8 |
)
|
| 9 |
|
| 10 |
def create_history_messages(history):
|
|
|
|
| 19 |
|
| 20 |
if seed == 0:
|
| 21 |
seed = random.randint(1, 100000)
|
| 22 |
+
|
| 23 |
stream = client.chat.completions.create(
|
| 24 |
messages=messages,
|
| 25 |
model=model,
|
|
|
|
| 82 |
theme=theme
|
| 83 |
)
|
| 84 |
|
| 85 |
+
with gr.Blocks(theme=theme) as demo:
|
| 86 |
+
gr.HTML(top_bar_html)
|
| 87 |
+
interface.render()
|
| 88 |
|
| 89 |
+
demo.launch()
|