Spaces:
Sleeping
Sleeping
File size: 1,142 Bytes
780954b be053b4 780954b be053b4 780954b 7974242 780954b 7974242 be053b4 6843cf8 be053b4 780954b be053b4 780954b be053b4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
from characters import get_character
from modules.llm import get_llm_model
from time import time
if __name__ == "__main__":
supported_llms = [
# "MiniMaxAI/MiniMax-Text-01",
# "Qwen/Qwen3-8B",
# "Qwen/Qwen3-30B-A3B",
# "meta-llama/Llama-3.1-8B-Instruct",
# "tiiuae/Falcon-H1-1B-Base",
# "tiiuae/Falcon-H1-3B-Instruct",
# "google/gemma-2-2b",
# "gemini-2.5-flash",
]
character_prompt = get_character("Yaoyin").prompt
for model_id in supported_llms:
try:
print(f"Loading model: {model_id}")
llm = get_llm_model(model_id, cache_dir="./.cache")
prompt = "你好,今天你心情怎么样?"
start_time = time()
result = llm.generate(prompt, system_prompt=character_prompt)
end_time = time()
print(f"[{model_id}] LLM inference time: {end_time - start_time:.2f} seconds")
print(f"[{model_id}] LLM inference result:", result)
except Exception as e:
print(f"Failed to load model {model_id}: {e}")
breakpoint()
continue
|