Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
import os
|
2 |
from transformers import AutoTokenizer
|
3 |
from optimum.intel.openvino import OVModelForCausalLM
|
4 |
-
from generation_utils import run_generation, estimate_latency, reset_textbox, get_special_token_id
|
5 |
-
from config import SUPPORTED_LLM_MODELS
|
6 |
import gradio as gr
|
7 |
from threading import Thread
|
8 |
from time import perf_counter
|
@@ -11,9 +9,14 @@ from transformers import TextIteratorStreamer
|
|
11 |
import numpy as np
|
12 |
|
13 |
# Model configuration and loading
|
14 |
-
model_dir = "phi-2/INT8_compressed_weights"
|
15 |
model_name = "susnato/phi-2"
|
16 |
-
model_configuration =
|
|
|
|
|
|
|
|
|
|
|
17 |
ov_config = {"PERFORMANCE_HINT": "LATENCY", "NUM_STREAMS": "1", "CACHE_DIR": ""}
|
18 |
|
19 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
@@ -199,4 +202,3 @@ def main():
|
|
199 |
|
200 |
if __name__ == "__main__":
|
201 |
main()
|
202 |
-
|
|
|
1 |
import os
|
2 |
from transformers import AutoTokenizer
|
3 |
from optimum.intel.openvino import OVModelForCausalLM
|
|
|
|
|
4 |
import gradio as gr
|
5 |
from threading import Thread
|
6 |
from time import perf_counter
|
|
|
9 |
import numpy as np
|
10 |
|
11 |
# Model configuration and loading
|
12 |
+
model_dir = "C:/Users/KIIT/OneDrive/Desktop/INTEL/phi-2/INT8_compressed_weights"
|
13 |
model_name = "susnato/phi-2"
|
14 |
+
model_configuration = {
|
15 |
+
"prompt_template": "{instruction}",
|
16 |
+
"toeknizer_kwargs": {},
|
17 |
+
"response_key": "### Response",
|
18 |
+
"end_key": "### End"
|
19 |
+
}
|
20 |
ov_config = {"PERFORMANCE_HINT": "LATENCY", "NUM_STREAMS": "1", "CACHE_DIR": ""}
|
21 |
|
22 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
|
202 |
|
203 |
if __name__ == "__main__":
|
204 |
main()
|
|