Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
dcc293a
1
Parent(s):
f5fd40b
Simplify MedSwin #8
Browse files
model.py
CHANGED
|
@@ -83,7 +83,6 @@ def initialize_medical_model(model_name: str):
|
|
| 83 |
return global_medical_models[model_name], global_medical_tokenizers[model_name]
|
| 84 |
|
| 85 |
|
| 86 |
-
@spaces.GPU(max_duration=120)
|
| 87 |
def get_llm_for_rag(temperature=0.7, max_new_tokens=256, top_p=0.95, top_k=50):
|
| 88 |
"""Get LLM for RAG indexing (uses medical model) - GPU only"""
|
| 89 |
# Use medical model for RAG indexing instead of translation model
|
|
@@ -103,12 +102,11 @@ def get_llm_for_rag(temperature=0.7, max_new_tokens=256, top_p=0.95, top_k=50):
|
|
| 103 |
)
|
| 104 |
|
| 105 |
|
| 106 |
-
@spaces.GPU(max_duration=120)
|
| 107 |
def get_embedding_model():
|
| 108 |
"""Get embedding model for RAG - GPU only"""
|
| 109 |
return HuggingFaceEmbedding(model_name=EMBEDDING_MODEL, token=HF_TOKEN)
|
| 110 |
|
| 111 |
-
|
| 112 |
def generate_with_medswin(
|
| 113 |
medical_model_obj,
|
| 114 |
medical_tokenizer,
|
|
|
|
| 83 |
return global_medical_models[model_name], global_medical_tokenizers[model_name]
|
| 84 |
|
| 85 |
|
|
|
|
| 86 |
def get_llm_for_rag(temperature=0.7, max_new_tokens=256, top_p=0.95, top_k=50):
|
| 87 |
"""Get LLM for RAG indexing (uses medical model) - GPU only"""
|
| 88 |
# Use medical model for RAG indexing instead of translation model
|
|
|
|
| 102 |
)
|
| 103 |
|
| 104 |
|
|
|
|
| 105 |
def get_embedding_model():
|
| 106 |
"""Get embedding model for RAG - GPU only"""
|
| 107 |
return HuggingFaceEmbedding(model_name=EMBEDDING_MODEL, token=HF_TOKEN)
|
| 108 |
|
| 109 |
+
@spaces.GPU(max_duration=120)
|
| 110 |
def generate_with_medswin(
|
| 111 |
medical_model_obj,
|
| 112 |
medical_tokenizer,
|