Upload app.py
Browse files111 unmodified lines11211311411511611776 unmodified lines194195196197198199111 unmodified linesos.mkdir("cache")snapshot_download(repo_id='TheBloke/CausalLM-7B-GGUF', local_dir=r'downloads',allow_patterns='causallm_7b.Q5_K_M.gguf')# ========== 加载模型 ==========model = StreamingLLM(model_path=setting_path.value,76 unmodified linespasstmp = model.save_session(setting_cache_path.value)print(f'save cache {tmp}')# ========== 流式输出函数 ==========111 unmodified lines11211311411511611711876 unmodified lines195196197198199200201202203204111 unmodified linesos.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 linespasstmp = model.save_session(setting_cache_path.value)print(f'save cache {tmp}')# ========== 上传缓存 ==========from huggingface_hub import login, CommitSchedulerlogin(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