Spaces:
Runtime error
Runtime error
Update chain_app.py
Browse files- chain_app.py +3 -4
chain_app.py
CHANGED
@@ -10,11 +10,10 @@ from huggingface_hub import InferenceClient
|
|
10 |
|
11 |
|
12 |
hf_token = os.environ.get("HF_TOKEN")
|
13 |
-
print(hf_token)
|
14 |
openai_api_key = os.environ.get('OPENAI_API_KEY')
|
15 |
groq_api_key = os.environ.get('GROQ_API_KEY')
|
16 |
cohere_api_key = os.environ.get('COHERE_API_KEY')
|
17 |
-
|
18 |
|
19 |
hf_text_client = Client("Artin2009/text-generation", hf_token=hf_token)
|
20 |
# hf_image_client = Client('Artin2009/image-generation')
|
@@ -22,7 +21,7 @@ openai_client = OpenAI(api_key=openai_api_key)
|
|
22 |
groq_client = Groq(api_key=groq_api_key)
|
23 |
|
24 |
co = cohere.Client(
|
25 |
-
api_key=cohere_api_key,
|
26 |
)
|
27 |
|
28 |
# API_URL = "https://api-inference.huggingface.co/models/PartAI/TookaBERT-Large"
|
@@ -629,7 +628,7 @@ async def main(message: cl.Message):
|
|
629 |
elif chat_profile == 'Llama-3.1-405B':
|
630 |
client = InferenceClient(
|
631 |
"meta-llama/Meta-Llama-3.1-405B-Instruct",
|
632 |
-
token=
|
633 |
)
|
634 |
|
635 |
for message in client.chat_completion(
|
|
|
10 |
|
11 |
|
12 |
hf_token = os.environ.get("HF_TOKEN")
|
|
|
13 |
openai_api_key = os.environ.get('OPENAI_API_KEY')
|
14 |
groq_api_key = os.environ.get('GROQ_API_KEY')
|
15 |
cohere_api_key = os.environ.get('COHERE_API_KEY')
|
16 |
+
|
17 |
|
18 |
hf_text_client = Client("Artin2009/text-generation", hf_token=hf_token)
|
19 |
# hf_image_client = Client('Artin2009/image-generation')
|
|
|
21 |
groq_client = Groq(api_key=groq_api_key)
|
22 |
|
23 |
co = cohere.Client(
|
24 |
+
api_key=cohere_api_key,
|
25 |
)
|
26 |
|
27 |
# API_URL = "https://api-inference.huggingface.co/models/PartAI/TookaBERT-Large"
|
|
|
628 |
elif chat_profile == 'Llama-3.1-405B':
|
629 |
client = InferenceClient(
|
630 |
"meta-llama/Meta-Llama-3.1-405B-Instruct",
|
631 |
+
token=hf_token,
|
632 |
)
|
633 |
|
634 |
for message in client.chat_completion(
|