Spaces:
Sleeping
Sleeping
Update src/models.py
Browse files- src/models.py +7 -4
src/models.py
CHANGED
@@ -25,17 +25,20 @@ classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnl
|
|
25 |
|
26 |
# Load LLM models using CTransformers
|
27 |
general_llm = CTransformers(
|
28 |
-
model="
|
29 |
model_type="llama",
|
30 |
-
config={'max_new_tokens': 512, 'temperature': 0.7}
|
|
|
31 |
)
|
32 |
|
33 |
medical_llm = CTransformers(
|
34 |
-
model="
|
35 |
model_type="llama",
|
36 |
-
config={'max_new_tokens': 512, 'temperature': 0.7}
|
|
|
37 |
)
|
38 |
|
|
|
39 |
# Prompt template for generating responses
|
40 |
template = """
|
41 |
You are a versatile AI assistant that can provide both medical advice and help users with general concerns, emotions, and questions outside the medical field. Your responses should be empathetic, supportive, and insightful, regardless of the topic.
|
|
|
25 |
|
26 |
# Load LLM models using CTransformers
|
27 |
general_llm = CTransformers(
|
28 |
+
model="/kaggle/working/llama-2-7b.Q8_0.gguf",
|
29 |
model_type="llama",
|
30 |
+
config={'max_new_tokens': 512, 'temperature': 0.7},
|
31 |
+
stream=True # Enable streaming here
|
32 |
)
|
33 |
|
34 |
medical_llm = CTransformers(
|
35 |
+
model="/kaggle/working/BioMistral-7B.Q8_0.gguf",
|
36 |
model_type="llama",
|
37 |
+
config={'max_new_tokens': 512, 'temperature': 0.7},
|
38 |
+
stream=True # Enable streaming here
|
39 |
)
|
40 |
|
41 |
+
|
42 |
# Prompt template for generating responses
|
43 |
template = """
|
44 |
You are a versatile AI assistant that can provide both medical advice and help users with general concerns, emotions, and questions outside the medical field. Your responses should be empathetic, supportive, and insightful, regardless of the topic.
|