Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,14 +17,6 @@ from gradio_helper import make_demo # UI logic import
|
|
| 17 |
from llm_config import SUPPORTED_LLM_MODELS
|
| 18 |
|
| 19 |
# Model configuration setup
|
| 20 |
-
model_name = model_configuration["model_id"]
|
| 21 |
-
start_message = model_configuration["start_message"]
|
| 22 |
-
history_template = model_configuration.get("history_template")
|
| 23 |
-
has_chat_template = model_configuration.get("has_chat_template", history_template is None)
|
| 24 |
-
current_message_template = model_configuration.get("current_message_template")
|
| 25 |
-
stop_tokens = model_configuration.get("stop_tokens")
|
| 26 |
-
tokenizer_kwargs = model_configuration.get("tokenizer_kwargs", {})
|
| 27 |
-
|
| 28 |
max_new_tokens = 256
|
| 29 |
model_language_value = "English"
|
| 30 |
model_id_value = 'qwen2.5-0.5b-instruct'
|
|
@@ -37,6 +29,15 @@ pt_model_name = model_id_value.split("-")[0]
|
|
| 37 |
int4_model_dir = Path(model_id_value) / "INT4_compressed_weights"
|
| 38 |
int4_weights = int4_model_dir / "openvino_model.bin"
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Model loading
|
| 41 |
core = ov.Core()
|
| 42 |
ov_config = {
|
|
|
|
| 17 |
from llm_config import SUPPORTED_LLM_MODELS
|
| 18 |
|
| 19 |
# Model configuration setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
max_new_tokens = 256
|
| 21 |
model_language_value = "English"
|
| 22 |
model_id_value = 'qwen2.5-0.5b-instruct'
|
|
|
|
| 29 |
int4_model_dir = Path(model_id_value) / "INT4_compressed_weights"
|
| 30 |
int4_weights = int4_model_dir / "openvino_model.bin"
|
| 31 |
|
| 32 |
+
model_configuration = SUPPORTED_LLM_MODELS[model_language_value][model_id_value]
|
| 33 |
+
model_name = model_configuration["model_id"]
|
| 34 |
+
start_message = model_configuration["start_message"]
|
| 35 |
+
history_template = model_configuration.get("history_template")
|
| 36 |
+
has_chat_template = model_configuration.get("has_chat_template", history_template is None)
|
| 37 |
+
current_message_template = model_configuration.get("current_message_template")
|
| 38 |
+
stop_tokens = model_configuration.get("stop_tokens")
|
| 39 |
+
tokenizer_kwargs = model_configuration.get("tokenizer_kwargs", {})
|
| 40 |
+
|
| 41 |
# Model loading
|
| 42 |
core = ov.Core()
|
| 43 |
ov_config = {
|