Spaces:
Running
Running
Update src/models.py
Browse files- src/models.py +5 -4
src/models.py
CHANGED
|
@@ -2,6 +2,7 @@ from openai import OpenAI
|
|
| 2 |
import anthropic
|
| 3 |
import os
|
| 4 |
from dotenv import load_dotenv
|
|
|
|
| 5 |
|
| 6 |
# Load environment variables from .env file
|
| 7 |
load_dotenv(override=True)
|
|
@@ -18,12 +19,12 @@ if not anthropic_api_key:
|
|
| 18 |
print("❌ Anthropic API Key is missing!")
|
| 19 |
|
| 20 |
# Initialize API clients
|
| 21 |
-
openai =
|
| 22 |
-
claude =
|
| 23 |
|
| 24 |
# Model names
|
| 25 |
-
OPENAI_MODEL = "
|
| 26 |
-
CLAUDE_MODEL = "
|
| 27 |
|
| 28 |
# Call OpenAI's GPT model with prompt and system message
|
| 29 |
def get_gpt_completion(prompt, system_message):
|
|
|
|
| 2 |
import anthropic
|
| 3 |
import os
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
+
from huggingface_hub import HfApi;
|
| 6 |
|
| 7 |
# Load environment variables from .env file
|
| 8 |
load_dotenv(override=True)
|
|
|
|
| 19 |
print("❌ Anthropic API Key is missing!")
|
| 20 |
|
| 21 |
# Initialize API clients
|
| 22 |
+
openai = HfApi(token=openai_api_key)
|
| 23 |
+
claude = HfApi(token=anthropic_api_key)
|
| 24 |
|
| 25 |
# Model names
|
| 26 |
+
OPENAI_MODEL = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 27 |
+
CLAUDE_MODEL = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 28 |
|
| 29 |
# Call OpenAI's GPT model with prompt and system message
|
| 30 |
def get_gpt_completion(prompt, system_message):
|