Spaces:
Running
on
TPU v5e
Running
on
TPU v5e
martin-gorner
commited on
Commit
·
ba64cc5
1
Parent(s):
3a9ff40
info string changes2
Browse files
app.py
CHANGED
@@ -29,21 +29,21 @@ from models import (
|
|
29 |
model_labels_list = list(model_labels)
|
30 |
|
31 |
# load and warm up (compile) all the models
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
# For local debugging
|
43 |
-
model = keras_hub.models.Llama3CausalLM.from_preset(
|
44 |
-
|
45 |
-
)
|
46 |
-
models = [model, model, model, model, model]
|
47 |
|
48 |
|
49 |
def chat_turn_assistant_1(
|
|
|
29 |
model_labels_list = list(model_labels)
|
30 |
|
31 |
# load and warm up (compile) all the models
|
32 |
+
models = []
|
33 |
+
for preset in model_presets:
|
34 |
+
model = load_model(preset)
|
35 |
+
chat_template = get_appropriate_chat_template(preset)
|
36 |
+
chat_state = ChatState(model, "", chat_template)
|
37 |
+
prompt, response = chat_state.send_message("Hello")
|
38 |
+
print("model " + preset + " loaded and initialized.")
|
39 |
+
print("The model responded: " + response)
|
40 |
+
models.append(model)
|
41 |
|
42 |
# For local debugging
|
43 |
+
# model = keras_hub.models.Llama3CausalLM.from_preset(
|
44 |
+
# "hf://meta-llama/Llama-3.2-1B-Instruct", dtype="bfloat16"
|
45 |
+
# )
|
46 |
+
# models = [model, model, model, model, model]
|
47 |
|
48 |
|
49 |
def chat_turn_assistant_1(
|