navin1890 commited on
Commit
67cc45a
·
verified ·
1 Parent(s): b898081

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
-
4
- client = InferenceClient("deepcogito/cogito-v2-preview-llama-109B-MoE")
 
5
 
6
  def chat(prompt):
7
  try:
8
- output = client.text_generation(prompt, max_new_tokens=150)
9
  return output
10
  except Exception as e:
11
  return f"Error: {e}"
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
+ import os
4
+ HF_TOKEN = os.getenv("HF_TOKEN")
5
+ client = InferenceClient("deepcogito/cogito-v2-preview-llama-109B-MoE", HF_TOKEN)
6
 
7
  def chat(prompt):
8
  try:
9
+ output = client.conversational(prompt, max_new_tokens=150)
10
  return output
11
  except Exception as e:
12
  return f"Error: {e}"