Spaces:
Runtime error
Runtime error
Update bt_generator.py
Browse files3 unmodified lines456789101112131415165 unmodified lines2223242526272829303179 unmodified lines1111121131141151163 unmodified linesimport textwrapimport reimport spaces# Download only the behavior-tree model shardmodel_path = hf_hub_download(repo_id="Inventors-Hub/SwarmChat-models",repo_type="model",filename="Falcon3-10B-Instruct-BehaviorTree-3epochs.Q4_K_M.gguf",)# llm = Llama(model_path=model_path, n_ctx=1024*4)5 unmodified lines# use_mmap=True, # mmap file# use_mlock=False,# )llm = None@spaces.GPUdef gpu_llm():llm = Llama(model_path=model_path,n_ctx=1024*4, # down from 409679 unmodified linesprompt = construct_prompt(task_prompt)print("\n\n",prompt,"\n\n")output = llm(prompt,3 unmodified lines4567891011125 unmodified lines181920212223242526272829303132333479 unmodified lines1141151161171181191203 unmodified linesimport textwrapimport reimport spacesimport functools# Download only the behavior-tree model shard# llm = Llama(model_path=model_path, n_ctx=1024*4)5 unmodified lines# use_mmap=True, # mmap file# use_mlock=False,# )@spaces.GPU@functools.lru_cache(maxsize=1)def gpu_llm():model_path = hf_hub_download(repo_id="Inventors-Hub/SwarmChat-models",repo_type="model",filename="Falcon3-10B-Instruct-BehaviorTree-3epochs.Q4_K_M.gguf",)llm = Llama(model_path=model_path,n_ctx=1024*4, # down from 409679 unmodified linesprompt = construct_prompt(task_prompt)print("\n\n",prompt,"\n\n")llm = gpu_llm()output = llm(prompt,
bt_generator.py+10-6