Update app.py
Browse files
app.py
CHANGED
|
@@ -65,13 +65,13 @@ def gradio_generate_text(prompt, max_length=100, num_return_sequences=1, top_p=0
|
|
| 65 |
# Ensure the models directory exists
|
| 66 |
if not os.path.exists('models'):
|
| 67 |
os.makedirs('models')
|
| 68 |
-
if not os.path.exists('models/vi-medical-
|
| 69 |
# Run the Git LFS commands to clone the model
|
| 70 |
run_shell_command('git lfs install')
|
| 71 |
-
run_shell_command('cd models && git clone https://huggingface.co/danhtran2mind/vi-medical-
|
| 72 |
|
| 73 |
# Load the trained model and tokenizer
|
| 74 |
-
model_path = "models/vi-medical-
|
| 75 |
tokenizer, model, device = load_model_and_tokenizer(model_path)
|
| 76 |
# Create Gradio interface
|
| 77 |
|
|
|
|
| 65 |
# Ensure the models directory exists
|
| 66 |
if not os.path.exists('models'):
|
| 67 |
os.makedirs('models')
|
| 68 |
+
if not os.path.exists('models/vi-medical-mt5-finetune-qa'):
|
| 69 |
# Run the Git LFS commands to clone the model
|
| 70 |
run_shell_command('git lfs install')
|
| 71 |
+
run_shell_command('cd models && git clone https://huggingface.co/danhtran2mind/vi-medical-mt5-finetune-qa && cd ..')
|
| 72 |
|
| 73 |
# Load the trained model and tokenizer
|
| 74 |
+
model_path = "models/vi-medical-mt5-finetune-qa"
|
| 75 |
tokenizer, model, device = load_model_and_tokenizer(model_path)
|
| 76 |
# Create Gradio interface
|
| 77 |
|