Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -336,8 +336,8 @@ def load_llm_model(model_path: str) -> Tuple[str, str]:
|
|
| 336 |
state.llm_model = LLM(
|
| 337 |
model=model_path,
|
| 338 |
tensor_parallel_size=tp_size,
|
| 339 |
-
gpu_memory_utilization=0.
|
| 340 |
-
max_model_len=
|
| 341 |
)
|
| 342 |
state.llm_tokenizer = state.llm_model.get_tokenizer()
|
| 343 |
return f"✓ LLM loaded from {model_path} (vLLM, tp={tp_size})", ""
|
|
@@ -916,10 +916,11 @@ def match_trials(patient_summary: str, patient_boilerplate: str, top_k: int = 20
|
|
| 916 |
|
| 917 |
result_df = top_trials[display_cols].reset_index(drop=True)
|
| 918 |
|
| 919 |
-
#
|
| 920 |
-
|
| 921 |
-
result_df['
|
| 922 |
-
result_df['
|
|
|
|
| 923 |
|
| 924 |
return result_df
|
| 925 |
|
|
|
|
| 336 |
state.llm_model = LLM(
|
| 337 |
model=model_path,
|
| 338 |
tensor_parallel_size=tp_size,
|
| 339 |
+
gpu_memory_utilization=0.15,
|
| 340 |
+
max_model_len=5000
|
| 341 |
)
|
| 342 |
state.llm_tokenizer = state.llm_model.get_tokenizer()
|
| 343 |
return f"✓ LLM loaded from {model_path} (vLLM, tp={tp_size})", ""
|
|
|
|
| 916 |
|
| 917 |
result_df = top_trials[display_cols].reset_index(drop=True)
|
| 918 |
|
| 919 |
+
# Convert probability columns to strings with fixed decimal places
|
| 920 |
+
# This ensures Gradio displays them correctly without extra decimals
|
| 921 |
+
result_df['eligibility_probability'] = result_df['eligibility_probability'].apply(lambda x: f"{x:.2f}")
|
| 922 |
+
result_df['exclusion_probability'] = result_df['exclusion_probability'].apply(lambda x: f"{x:.2f}")
|
| 923 |
+
result_df['similarity_score'] = result_df['similarity_score'].apply(lambda x: f"{x:.3f}")
|
| 924 |
|
| 925 |
return result_df
|
| 926 |
|