Upload app.py
Browse files111 unmodified lines11211311411511611711876 unmodified lines195196197198199200201202203204111 unmodified lines os.mkdir("cache") snapshot_download(repo_id='TheBloke/CausalLM-7B-GGUF', local_dir=r'downloads', allow_patterns='causallm_7b.Q5_K_M.gguf') snapshot_download(repo_id='Limour/llama-python-streamingllm-cache', repo_type='dataset', local_dir=r'cache')
# ========== 加载模型 ========== model = StreamingLLM(model_path=setting_path.value,76 unmodified lines pass tmp = model.save_session(setting_cache_path.value) print(f'save cache {tmp}') # ========== 上传缓存 ========== from huggingface_hub import login, CommitScheduler login(token=os.environ.get("HF_TOKEN"), write_permission=True) CommitScheduler(repo_id='Limour/llama-python-streamingllm-cache', repo_type='dataset', folder_path='cache')
# ========== 流式输出函数 ==========app.py+5