-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.py
More file actions
38 lines (29 loc) · 1.08 KB
/
model.py
File metadata and controls
38 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os, sys
# Add the current directory to the path so we can import from models
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from gpt_4o_azure import gpt_4o_azure
#this is the models API. You pass the model (name of the model) and prompt, the API will return the response out
def model(prompt, model_name = 'gpt_4o_azure'):
if(model_name == 'gpt_41_mini_azure'):
return gpt_41_mini_azure(prompt)
if(model_name == 'gpt_4o_azure'):
return gpt_4o_azure(prompt)
return 'input model does not exist'
def test_model():
"""
Test function to verify the model is working correctly.
"""
print("Testing model...")
# Test prompt
test_prompt = ["What is the capital of France?", " Please answer in one word."]
try:
# Test the model
result = model(test_prompt)
print(f"Model response: {result}")
print("✅ Model test successful!")
return True
except Exception as e:
print(f"❌ Model test failed: {str(e)}")
return False
if __name__ == "__main__":
test_model()