anktechsol commited on
Commit
4d691ea
·
verified ·
1 Parent(s): 0d9116e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from huggingface_hub import InferenceClient
3
 
4
  AVAILABLE_MODELS = [
@@ -27,7 +28,7 @@ def chat(message, history, selected_models):
27
  responses = []
28
  for model in selected_models:
29
  try:
30
- client = InferenceClient(model=model)
31
  try:
32
  result = client.chat_completion(
33
  messages=[{"role": "user", "content": message}],
 
1
  import gradio as gr
2
+ import os
3
  from huggingface_hub import InferenceClient
4
 
5
  AVAILABLE_MODELS = [
 
28
  responses = []
29
  for model in selected_models:
30
  try:
31
+ client = InferenceClient(model=model, token=os.getenv("HF_TOKEN"))
32
  try:
33
  result = client.chat_completion(
34
  messages=[{"role": "user", "content": message}],