Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
# Initialize the hugging face inference api client
|
|
@@ -12,7 +13,7 @@ def generate_text(category, theme, tone, length):
|
|
| 12 |
|
| 13 |
try:
|
| 14 |
completion = client.chat.completions.create(
|
| 15 |
-
model="
|
| 16 |
messages=[{"role":"user", "content":prompt}],
|
| 17 |
)
|
| 18 |
return completion.choices[0].message.content
|
|
|
|
| 1 |
import os
|
| 2 |
+
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
# Initialize the hugging face inference api client
|
|
|
|
| 13 |
|
| 14 |
try:
|
| 15 |
completion = client.chat.completions.create(
|
| 16 |
+
model="mistralai/Mistral-7B-Instruct-v0.1",
|
| 17 |
messages=[{"role":"user", "content":prompt}],
|
| 18 |
)
|
| 19 |
return completion.choices[0].message.content
|