Spaces:
Running
Running
Update predict_stress.py
Browse files- predict_stress.py +3 -2
predict_stress.py
CHANGED
@@ -11,10 +11,11 @@ from langchain_core.output_parsers import StrOutputParser
|
|
11 |
|
12 |
xgboostmodel_id = "Sannidhi/stress_prediction_xgboost_model"
|
13 |
xgboost_model = None
|
|
|
14 |
generator = pipeline("text-generation", model=model_id)
|
15 |
-
model_id="unsloth/Llama-3.2-1B-Instruct"
|
16 |
|
17 |
-
|
|
|
18 |
"""Generates a response from the Hugging Face model for a given prompt text."""
|
19 |
try:
|
20 |
llm = HuggingFaceEndpoint(
|
|
|
11 |
|
12 |
xgboostmodel_id = "Sannidhi/stress_prediction_xgboost_model"
|
13 |
xgboost_model = None
|
14 |
+
model_id="meta-llama/Llama-3.2-1B-Instruct"
|
15 |
generator = pipeline("text-generation", model=model_id)
|
|
|
16 |
|
17 |
+
|
18 |
+
def get_llm_response(prompt_text, model_id="meta-llama/Llama-3.2-1B-Instruct", max_new_tokens=256, temperature=0.5):
|
19 |
"""Generates a response from the Hugging Face model for a given prompt text."""
|
20 |
try:
|
21 |
llm = HuggingFaceEndpoint(
|