Aksh1t commited on
Commit
65be8fe
1 Parent(s): f4909a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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(model=model_id, text=prompt)
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
+