Spaces:
Running
Running
Update chat.py
Browse files
chat.py
CHANGED
|
@@ -10,6 +10,8 @@ load_dotenv(dotenv_path=env_path)
|
|
| 10 |
# Use Qwen 2.5 - works well with chat and is less restricted
|
| 11 |
MODEL_ID = "NousResearch/Hermes-2-Pro-Llama-3-8B"
|
| 12 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
|
|
|
|
|
|
| 13 |
|
| 14 |
def get_chat_response(message: str, history: list):
|
| 15 |
client = InferenceClient(model=MODEL_ID, token=HF_TOKEN)
|
|
|
|
| 10 |
# Use Qwen 2.5 - works well with chat and is less restricted
|
| 11 |
MODEL_ID = "NousResearch/Hermes-2-Pro-Llama-3-8B"
|
| 12 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 13 |
+
if HF_TOKEN:
|
| 14 |
+
HF_TOKEN = HF_TOKEN.strip()
|
| 15 |
|
| 16 |
def get_chat_response(message: str, history: list):
|
| 17 |
client = InferenceClient(model=MODEL_ID, token=HF_TOKEN)
|