Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,11 @@ import asyncio
|
|
6 |
model_id = 'Aksh1t/mistral-7b-oig-unsloth-merged'
|
7 |
|
8 |
# Initialize the Hugging Face inference client
|
9 |
-
client = InferenceClient()
|
10 |
|
11 |
async def generate_text(prompt):
|
12 |
# Use the Hugging Face client to generate text asynchronously
|
13 |
-
response = await client.text_generation(
|
14 |
return response['generated_text']
|
15 |
|
16 |
# Create Gradio interface
|
@@ -25,3 +25,4 @@ iface = gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title="Hugging
|
|
25 |
|
26 |
if __name__ == "__main__":
|
27 |
iface.launch()
|
|
|
|
6 |
model_id = 'Aksh1t/mistral-7b-oig-unsloth-merged'
|
7 |
|
8 |
# Initialize the Hugging Face inference client
|
9 |
+
client = InferenceClient(model=model_id)
|
10 |
|
11 |
async def generate_text(prompt):
|
12 |
# Use the Hugging Face client to generate text asynchronously
|
13 |
+
response = await client.text_generation(prompt)
|
14 |
return response['generated_text']
|
15 |
|
16 |
# Create Gradio interface
|
|
|
25 |
|
26 |
if __name__ == "__main__":
|
27 |
iface.launch()
|
28 |
+
|