{"id":88129,"date":"2026-07-31T15:24:58","date_gmt":"2026-07-31T07:24:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/88129.html"},"modified":"2026-07-31T15:24:58","modified_gmt":"2026-07-31T07:24:58","slug":"qwen2-5-1-5b-streamlit%e9%83%a8%e7%bd%b2%e6%95%99%e7%a8%8b%ef%bc%9a%e9%98%bf%e9%87%8c%e4%ba%91ecs%e8%bd%bb%e9%87%8f%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%80%e9%94%ae%e9%83%a8%e7%bd%b2%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/88129.html","title":{"rendered":"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab"},"content":{"rendered":"<h2>Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b&#xff1a;\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab<\/h2>\n<h3>1. \u5b66\u4e60\u76ee\u6807\u4e0e\u9879\u76ee\u4ef7\u503c<\/h3>\n<p>\u4f60\u662f\u4e0d\u662f\u4e5f\u60f3\u5728\u672c\u5730\u642d\u5efa\u4e00\u4e2a\u5c5e\u4e8e\u81ea\u5df1\u7684AI\u5bf9\u8bdd\u52a9\u624b&#xff0c;\u4f46\u53c8\u62c5\u5fc3\u6280\u672f\u95e8\u69db\u592a\u9ad8\u3001\u914d\u7f6e\u592a\u590d\u6742&#xff1f;\u4eca\u5929&#xff0c;\u6211\u5c31\u5e26\u4f60\u752810\u5206\u949f\u65f6\u95f4&#xff0c;\u5728\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e0a&#xff0c;\u628a\u963f\u91cc\u901a\u4e49\u5343\u95ee\u7684\u8f7b\u91cf\u7ea7\u5927\u6a21\u578bQwen2.5-1.5B\u8dd1\u8d77\u6765&#xff0c;\u5e76\u7ed9\u5b83\u914d\u4e0a\u4e00\u4e2a\u6f02\u4eae\u7684\u7f51\u9875\u804a\u5929\u754c\u9762\u3002<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u6700\u5927\u7684\u7279\u70b9\u5c31\u662f\u7b80\u5355\u3002\u4f60\u4e0d\u7528\u53bb\u6298\u817e\u590d\u6742\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6&#xff0c;\u4e5f\u4e0d\u7528\u62c5\u5fc3\u663e\u5b58\u4e0d\u591f\u3002\u6211\u4eec\u57fa\u4e8e\u5b98\u65b9\u76841.5B\u5c0f\u6a21\u578b&#xff0c;\u7528Streamlit\u8fd9\u4e2a\u8f7b\u91cf\u7ea7\u5de5\u5177\u505a\u4e2a\u7f51\u9875&#xff0c;\u6240\u6709\u5bf9\u8bdd\u90fd\u5728\u4f60\u7684\u670d\u52a1\u5668\u672c\u5730\u5b8c\u6210&#xff0c;\u6570\u636e\u7edd\u5bf9\u5b89\u5168\u3002<\/p>\n<p>\u5b66\u5b8c\u8fd9\u7bc7\u6559\u7a0b&#xff0c;\u4f60\u5c06\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u5728\u963f\u91cc\u4e91ECS\u670d\u52a1\u5668\u4e0a&#xff0c;\u4e00\u952e\u90e8\u7f72\u4e00\u4e2a\u79c1\u6709\u5316\u7684AI\u5bf9\u8bdd\u670d\u52a1\u3002<\/li>\n<li>\u901a\u8fc7\u6d4f\u89c8\u5668&#xff0c;\u50cf\u4f7f\u7528ChatGPT\u4e00\u6837\u4e0e\u672c\u5730\u6a21\u578b\u8fdb\u884c\u591a\u8f6e\u5bf9\u8bdd\u3002<\/li>\n<li>\u7406\u89e3\u5982\u4f55\u5c06\u5927\u6a21\u578b\u4e0eWeb\u5e94\u7528\u7ed3\u5408&#xff0c;\u6253\u9020\u5f00\u7bb1\u5373\u7528\u7684AI\u5de5\u5177\u3002<\/li>\n<\/ul>\n<h3>2. \u73af\u5883\u51c6\u5907\u4e0e\u9879\u76ee\u7ed3\u6784<\/h3>\n<h4>2.1 \u4f60\u9700\u8981\u51c6\u5907\u4ec0\u4e48<\/h4>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d&#xff0c;\u8bf7\u786e\u4fdd\u4f60\u62e5\u6709\u4ee5\u4e0b\u8d44\u6e90&#xff1a;<\/p>\n<ul>\n<li>\u4e00\u53f0\u963f\u91cc\u4e91ECS\u5b9e\u4f8b&#xff1a;\u5efa\u8bae\u9009\u62e9\u914d\u7f6e\u4e3a2\u68384G\u6216\u4ee5\u4e0a\u7684\u8f7b\u91cf\u5e94\u7528\u670d\u52a1\u5668\u3002\u64cd\u4f5c\u7cfb\u7edf\u63a8\u8350Ubuntu 22.04 LTS\u3002<\/li>\n<li>\u57fa\u7840\u7684Linux\u64cd\u4f5c\u77e5\u8bc6&#xff1a;\u4f1a\u4f7f\u7528SSH\u8fde\u63a5\u670d\u52a1\u5668&#xff0c;\u4f1a\u6267\u884c\u57fa\u672c\u7684\u547d\u4ee4\u884c\u64cd\u4f5c\u3002<\/li>\n<li>\u4e00\u4e2a\u53ef\u4ee5\u8bbf\u95ee\u7684\u516c\u7f51IP\u6216\u57df\u540d&#xff1a;\u7528\u4e8e\u4ece\u5916\u90e8\u8bbf\u95ee\u4f60\u7684Streamlit\u670d\u52a1\u3002<\/li>\n<\/ul>\n<h4>2.2 \u9879\u76ee\u6838\u5fc3\u6587\u4ef6\u4e00\u89c8<\/h4>\n<p>\u6211\u4eec\u7684\u90e8\u7f72\u811a\u672c\u4f1a\u628a\u6240\u6709\u4e8b\u60c5\u90fd\u5b89\u6392\u597d\u3002\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206&#xff1a;<\/p>\n<li>\u6a21\u578b\u6587\u4ef6&#xff1a;\u4f60\u9700\u8981\u63d0\u524d\u4e0b\u8f7d\u597d\u7684Qwen2.5-1.5B-Instruct\u6a21\u578b\u3002<\/li>\n<li>Python\u811a\u672c (app.py)&#xff1a;\u8fd9\u662f\u6838\u5fc3&#xff0c;\u5305\u542b\u4e86\u6a21\u578b\u52a0\u8f7d\u3001\u5bf9\u8bdd\u903b\u8f91\u548cWeb\u754c\u9762\u3002<\/li>\n<li>\u4f9d\u8d56\u6587\u4ef6 (requirements.txt)&#xff1a;\u5217\u51fa\u4e86\u8fd0\u884c\u6240\u9700\u7684\u6240\u6709Python\u5e93\u3002<\/li>\n<li>\u542f\u52a8\u811a\u672c (start.sh)&#xff1a;\u4e00\u4e2a\u65b9\u4fbf\u7684\u4e00\u952e\u542f\u52a8\u811a\u672c\u3002<\/li>\n<p>\u6574\u4e2a\u9879\u76ee\u7684\u903b\u8f91\u5f88\u7b80\u5355&#xff1a;\u811a\u672c\u542f\u52a8\u4e00\u4e2aWeb\u670d\u52a1&#xff0c;\u4f60\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u8fd9\u4e2a\u670d\u52a1&#xff0c;\u8f93\u5165\u95ee\u9898&#xff0c;\u811a\u672c\u8c03\u7528\u672c\u5730\u7684\u6a21\u578b\u751f\u6210\u56de\u7b54&#xff0c;\u518d\u628a\u7ed3\u679c\u5c55\u793a\u5728\u7f51\u9875\u4e0a\u3002<\/p>\n<h3>3. \u5206\u6b65\u90e8\u7f72\u64cd\u4f5c\u6307\u5357<\/h3>\n<h4>3.1 \u7b2c\u4e00\u6b65&#xff1a;\u767b\u5f55\u670d\u52a1\u5668\u4e0e\u57fa\u7840\u73af\u5883\u914d\u7f6e<\/h4>\n<p>\u9996\u5148&#xff0c;\u901a\u8fc7SSH\u8fde\u63a5\u5230\u4f60\u7684\u963f\u91cc\u4e91ECS\u670d\u52a1\u5668\u3002<\/p>\n<p>ssh root&#064;\u4f60\u7684\u670d\u52a1\u5668\u516c\u7f51IP<\/p>\n<p>\u8fde\u63a5\u6210\u529f\u540e&#xff0c;\u6211\u4eec\u5148\u66f4\u65b0\u7cfb\u7edf\u5e76\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u5de5\u5177\u3002<\/p>\n<p># \u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868<br \/>\napt-get update<\/p>\n<p># \u5b89\u88c5Python3\u3001pip\u548c\u9879\u76ee\u9700\u8981\u7684\u7cfb\u7edf\u4f9d\u8d56<br \/>\napt-get install -y python3-pip python3-venv git<\/p>\n<p># \u9a8c\u8bc1\u5b89\u88c5<br \/>\npython3 &#8211;version<br \/>\npip3 &#8211;version<\/p>\n<h4>3.2 \u7b2c\u4e8c\u6b65&#xff1a;\u51c6\u5907\u6a21\u578b\u6587\u4ef6<\/h4>\n<p>\u8fd9\u662f\u6700\u5173\u952e\u7684\u4e00\u6b65\u3002\u4f60\u9700\u8981\u5c06Qwen2.5-1.5B-Instruct\u7684\u6a21\u578b\u6587\u4ef6\u4e0b\u8f7d\u5230\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<p>\u65b9\u6cd5\u4e00&#xff1a;\u76f4\u63a5\u4ece\u670d\u52a1\u5668\u4e0b\u8f7d&#xff08;\u63a8\u8350&#xff09; \u5728\u670d\u52a1\u5668\u4e0a&#xff0c;\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528git\u6765\u514b\u9686\u5305\u542b\u6a21\u578b\u6587\u4ef6\u7684\u4ed3\u5e93&#xff08;\u5982\u679c\u6a21\u578b\u63d0\u4f9b\u65b9\u4f7f\u7528\u4e86Git LFS&#xff09;\u3002\u6216\u8005&#xff0c;\u5982\u679c\u4f60\u6709\u6a21\u578b\u7684\u4e0b\u8f7d\u94fe\u63a5&#xff0c;\u53ef\u4ee5\u7528wget\u3002<\/p>\n<p># \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u6765\u5b58\u653e\u6a21\u578b&#xff0c;\u8fd9\u4e2a\u8def\u5f84\u5728\u540e\u7eed\u4ee3\u7801\u4e2d\u4f1a\u7528\u5230<br \/>\nmkdir -p \/root\/qwen1.5b<br \/>\ncd \/root\/qwen1.5b<\/p>\n<p># \u5047\u8bbe\u4f60\u6709\u6a21\u578b\u7684\u4e0b\u8f7d\u94fe\u63a5&#xff0c;\u4f7f\u7528wget\u4e0b\u8f7d&#xff08;\u8bf7\u66ff\u6362\u4e3a\u771f\u5b9e\u94fe\u63a5&#xff09;<br \/>\n# wget https:\/\/example.com\/path\/to\/qwen2.5-1.5b-instruct.tar.gz<br \/>\n# tar -xzf qwen2.5-1.5b-instruct.tar.gz<\/p>\n<p># \u66f4\u5e38\u89c1\u7684\u60c5\u51b5\u662f\u4eceHugging Face\u4e0b\u8f7d&#xff08;\u9700\u8981\u5148\u5b89\u88c5git-lfs&#xff09;<br \/>\n# apt-get install -y git-lfs<br \/>\n# git lfs install<br \/>\n# git clone https:\/\/huggingface.co\/Qwen\/Qwen2.5-1.5B-Instruct .<\/p>\n<p>\u65b9\u6cd5\u4e8c&#xff1a;\u4ece\u672c\u5730\u4e0a\u4f20 \u5982\u679c\u4f60\u5df2\u7ecf\u5728\u672c\u5730\u4e0b\u597d\u4e86\u6a21\u578b\u6587\u4ef6&#xff0c;\u53ef\u4ee5\u4f7f\u7528scp\u547d\u4ee4\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u3002<\/p>\n<p># \u5728\u4f60\u7684\u672c\u5730\u7535\u8111\u7ec8\u7aef\u6267\u884c<br \/>\nscp -r \/\u672c\u5730\/\u6a21\u578b\u6587\u4ef6\u5939\u8def\u5f84 root&#064;\u4f60\u7684\u670d\u52a1\u5668\u516c\u7f51IP:\/root\/qwen1.5b<\/p>\n<p>\u65e0\u8bba\u7528\u54ea\u79cd\u65b9\u6cd5&#xff0c;\u6700\u7ec8\u8bf7\u786e\u4fdd\/root\/qwen1.5b\u76ee\u5f55\u4e0b\u5305\u542bconfig.json, model.safetensors (\u6216 .bin\u6587\u4ef6), tokenizer.json\u7b49\u6a21\u578b\u5fc5\u9700\u6587\u4ef6\u3002<\/p>\n<h4>3.3 \u7b2c\u4e09\u6b65&#xff1a;\u521b\u5efa\u9879\u76ee\u5e76\u7f16\u5199\u6838\u5fc3\u4ee3\u7801<\/h4>\n<p>\u73b0\u5728&#xff0c;\u6211\u4eec\u6765\u521b\u5efa\u9879\u76ee\u76ee\u5f55\u548c\u6838\u5fc3\u6587\u4ef6\u3002<\/p>\n<p># \u56de\u5230\u7528\u6237\u6839\u76ee\u5f55&#xff0c;\u521b\u5efa\u9879\u76ee\u6587\u4ef6\u5939<br \/>\ncd \/root<br \/>\nmkdir qwen_streamlit_app &amp;&amp; cd qwen_streamlit_app<\/p>\n<p>\u9996\u5148&#xff0c;\u521b\u5efaPython\u4f9d\u8d56\u6587\u4ef6requirements.txt\u3002<\/p>\n<p>cat &gt; requirements.txt &lt;&lt; &#039;EOF&#039;<br \/>\nstreamlit&gt;&#061;1.28.0<br \/>\ntorch&gt;&#061;2.0.0<br \/>\ntransformers&gt;&#061;4.35.0<br \/>\naccelerate&gt;&#061;0.24.0<br \/>\nsentencepiece<br \/>\ntiktoken<br \/>\nEOF<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u521b\u5efa\u6838\u5fc3\u5e94\u7528\u811a\u672capp.py\u3002\u8fd9\u6bb5\u4ee3\u7801\u5b9e\u73b0\u4e86\u6a21\u578b\u52a0\u8f7d\u548c\u804a\u5929\u754c\u9762\u3002<\/p>\n<p># app.py<br \/>\nimport streamlit as st<br \/>\nfrom transformers import AutoModelForCausalLM, AutoTokenizer<br \/>\nimport torch<\/p>\n<p># \u8bbe\u7f6e\u9875\u9762\u6807\u9898\u548c\u56fe\u6807<br \/>\nst.set_page_config(page_title&#061;&#034;Qwen2.5-1.5B \u672c\u5730\u52a9\u624b&#034;, page_icon&#061;&#034;&#x1f916;&#034;)<\/p>\n<p># \u5b9a\u4e49\u6a21\u578b\u8def\u5f84&#xff0c;\u5fc5\u987b\u4e0e\u4f60\u5b58\u653e\u6a21\u578b\u7684\u8def\u5f84\u4e00\u81f4<br \/>\nMODEL_PATH &#061; &#034;\/root\/qwen1.5b&#034;<\/p>\n<p>&#064;st.cache_resource<br \/>\ndef load_model_and_tokenizer():<br \/>\n    &#034;&#034;&#034;\u52a0\u8f7d\u6a21\u578b\u548c\u5206\u8bcd\u5668&#xff0c;\u5229\u7528Streamlit\u7f13\u5b58\u53ea\u52a0\u8f7d\u4e00\u6b21&#034;&#034;&#034;<br \/>\n    st.info(f&#034;&#x1f680; \u6b63\u5728\u52a0\u8f7d\u6a21\u578b&#xff0c;\u8bf7\u7a0d\u5019&#8230; (\u8def\u5f84: {MODEL_PATH})&#034;)<br \/>\n    tokenizer &#061; AutoTokenizer.from_pretrained(MODEL_PATH, trust_remote_code&#061;True)<\/p>\n<p>    # \u81ea\u52a8\u9009\u62e9\u8fd0\u884c\u8bbe\u5907&#xff08;GPU\/CPU&#xff09;\u548c\u6570\u636e\u7c7b\u578b<br \/>\n    model &#061; AutoModelForCausalLM.from_pretrained(<br \/>\n        MODEL_PATH,<br \/>\n        torch_dtype&#061;&#034;auto&#034;,<br \/>\n        device_map&#061;&#034;auto&#034;,<br \/>\n        trust_remote_code&#061;True<br \/>\n    )<br \/>\n    model.eval()  # \u8bbe\u7f6e\u4e3a\u8bc4\u4f30\u6a21\u5f0f&#xff0c;\u8282\u7701\u8d44\u6e90<br \/>\n    st.success(&#034;\u2705 \u6a21\u578b\u52a0\u8f7d\u6210\u529f&#xff01;&#034;)<br \/>\n    return model, tokenizer<\/p>\n<p># \u4fa7\u8fb9\u680f\u914d\u7f6e<br \/>\nwith st.sidebar:<br \/>\n    st.title(&#034;\u2699\ufe0f \u8bbe\u7f6e\u4e0e\u63a7\u5236&#034;)<br \/>\n    st.markdown(&#034;&#8212;&#034;)<br \/>\n    if st.button(&#034;&#x1f9f9; \u6e05\u7a7a\u5bf9\u8bdd\u5386\u53f2&#034;, use_container_width&#061;True):<br \/>\n        st.session_state.messages &#061; []<br \/>\n        st.rerun()  # \u6e05\u7a7a\u540e\u5237\u65b0\u754c\u9762<br \/>\n        torch.cuda.empty_cache() if torch.cuda.is_available() else None<br \/>\n        st.sidebar.success(&#034;\u5bf9\u8bdd\u5386\u53f2\u5df2\u6e05\u7a7a&#xff0c;\u663e\u5b58\u5df2\u91ca\u653e\u3002&#034;)<\/p>\n<p>    st.markdown(&#034;&#8212;&#034;)<br \/>\n    st.markdown(&#034;**\u5173\u4e8e**&#034;)<br \/>\n    st.caption(&#034;\u57fa\u4e8e Qwen2.5-1.5B-Instruct \u6784\u5efa\u7684\u672c\u5730\u5bf9\u8bdd\u52a9\u624b\u3002\u6240\u6709\u6570\u636e\u5747\u5728\u672c\u5730\u5904\u7406\u3002&#034;)<\/p>\n<p># \u521d\u59cb\u5316\u804a\u5929\u5386\u53f2<br \/>\nif &#034;messages&#034; not in st.session_state:<br \/>\n    st.session_state.messages &#061; []<\/p>\n<p># \u52a0\u8f7d\u6a21\u578b&#xff08;\u9996\u6b21\u8fd0\u884c\u4f1a\u89e6\u53d1\u52a0\u8f7d&#xff09;<br \/>\nmodel, tokenizer &#061; load_model_and_tokenizer()<\/p>\n<p># \u4e3b\u754c\u9762\u6807\u9898<br \/>\nst.title(&#034;&#x1f4ac; Qwen2.5-1.5B \u672c\u5730\u667a\u80fd\u52a9\u624b&#034;)<br \/>\nst.caption(&#034;\u5b8c\u5168\u672c\u5730\u8fd0\u884c \u00b7 \u9690\u79c1\u5b89\u5168 \u00b7 \u5f00\u7bb1\u5373\u7528&#034;)<\/p>\n<p># \u663e\u793a\u5386\u53f2\u804a\u5929\u8bb0\u5f55<br \/>\nfor message in st.session_state.messages:<br \/>\n    with st.chat_message(message[&#034;role&#034;]):<br \/>\n        st.markdown(message[&#034;content&#034;])<\/p>\n<p># \u804a\u5929\u8f93\u5165\u6846<br \/>\nif prompt :&#061; st.chat_input(&#034;\u4f60\u597d&#xff0c;\u6211\u662fQwen&#xff0c;\u6709\u4ec0\u4e48\u53ef\u4ee5\u5e2e\u4f60\u7684&#xff1f;&#034;):<br \/>\n    # \u5c06\u7528\u6237\u8f93\u5165\u6dfb\u52a0\u5230\u5386\u53f2\u5e76\u663e\u793a<br \/>\n    st.session_state.messages.append({&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: prompt})<br \/>\n    with st.chat_message(&#034;user&#034;):<br \/>\n        st.markdown(prompt)<\/p>\n<p>    # \u751f\u6210AI\u56de\u590d<br \/>\n    with st.chat_message(&#034;assistant&#034;):<br \/>\n        message_placeholder &#061; st.empty()  # \u521b\u5efa\u4e00\u4e2a\u5360\u4f4d\u7b26\u7528\u4e8e\u6d41\u5f0f\u8f93\u51fa<br \/>\n        full_response &#061; &#034;&#034;<\/p>\n<p>        # \u51c6\u5907\u6a21\u578b\u8f93\u5165<br \/>\n        # \u4f7f\u7528\u6a21\u578b\u7684\u5b98\u65b9\u804a\u5929\u6a21\u677f\u6765\u683c\u5f0f\u5316\u5bf9\u8bdd\u5386\u53f2<br \/>\n        conversation &#061; [{&#034;role&#034;: msg[&#034;role&#034;], &#034;content&#034;: msg[&#034;content&#034;]} for msg in st.session_state.messages]<br \/>\n        text &#061; tokenizer.apply_chat_template(conversation, tokenize&#061;False, add_generation_prompt&#061;True)<br \/>\n        inputs &#061; tokenizer(text, return_tensors&#061;&#034;pt&#034;).to(model.device)<\/p>\n<p>        # \u751f\u6210\u56de\u590d<br \/>\n        with torch.no_grad():  # \u7981\u7528\u68af\u5ea6\u8ba1\u7b97&#xff0c;\u5927\u5e45\u8282\u7701\u663e\u5b58<br \/>\n            generated_ids &#061; model.generate(<br \/>\n                **inputs,<br \/>\n                max_new_tokens&#061;1024,  # \u6700\u591a\u751f\u62101024\u4e2a\u65b0token<br \/>\n                do_sample&#061;True,       # \u542f\u7528\u91c7\u6837&#xff0c;\u4f7f\u56de\u7b54\u66f4\u591a\u6837<br \/>\n                temperature&#061;0.7,      # \u91c7\u6837\u6e29\u5ea6&#xff0c;\u63a7\u5236\u968f\u673a\u6027<br \/>\n                top_p&#061;0.9,            # \u6838\u91c7\u6837\u53c2\u6570&#xff0c;\u63a7\u5236\u8bcd\u6c47\u9009\u62e9\u8303\u56f4<br \/>\n                repetition_penalty&#061;1.1 # \u91cd\u590d\u60e9\u7f5a&#xff0c;\u907f\u514d\u91cd\u590d\u7528\u8bcd<br \/>\n            )<\/p>\n<p>        # \u89e3\u7801\u5e76\u8f93\u51fa\u751f\u6210\u7684\u6587\u672c&#xff08;\u8df3\u8fc7\u8f93\u5165\u90e8\u5206&#xff09;<br \/>\n        new_tokens &#061; generated_ids[0, inputs[&#039;input_ids&#039;].shape[1]:]<br \/>\n        response &#061; tokenizer.decode(new_tokens, skip_special_tokens&#061;True)<\/p>\n<p>        # \u6a21\u62df\u9010\u5b57\u8f93\u51fa\u6548\u679c&#xff0c;\u63d0\u5347\u4f53\u9a8c<br \/>\n        for chunk in response:<br \/>\n            full_response &#043;&#061; chunk<br \/>\n            message_placeholder.markdown(full_response &#043; &#034;\u258c&#034;)<br \/>\n        message_placeholder.markdown(full_response)<\/p>\n<p>    # \u5c06AI\u56de\u590d\u6dfb\u52a0\u5230\u5386\u53f2<br \/>\n    st.session_state.messages.append({&#034;role&#034;: &#034;assistant&#034;, &#034;content&#034;: full_response})<\/p>\n<h4>3.4 \u7b2c\u56db\u6b65&#xff1a;\u5b89\u88c5\u4f9d\u8d56\u5e76\u9996\u6b21\u542f\u52a8<\/h4>\n<p>\u4ee3\u7801\u5199\u597d\u4e86&#xff0c;\u73b0\u5728\u6765\u5b89\u88c5\u8fd0\u884c\u5b83\u9700\u8981\u7684Python\u5e93\u3002<\/p>\n<p># \u5728\u9879\u76ee\u76ee\u5f55\u4e0b&#xff0c;\u5b89\u88c5\u4f9d\u8d56<br \/>\npip3 install -r requirements.txt<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884cStreamlit\u5e94\u7528\u3002\u4f46\u4e3a\u4e86\u8ba9\u670d\u52a1\u5728\u540e\u53f0\u8fd0\u884c\u4e14\u4e0d\u53d7SSH\u4f1a\u8bdd\u5f71\u54cd&#xff0c;\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u542f\u52a8\u811a\u672cstart.sh\u3002<\/p>\n<p>cat &gt; start.sh &lt;&lt; &#039;EOF&#039;<br \/>\n#!\/bin\/bash<br \/>\necho &#034;\u542f\u52a8 Qwen2.5-1.5B Streamlit \u670d\u52a1&#8230;&#034;<br \/>\necho &#034;\u670d\u52a1\u5c06\u5728\u540e\u53f0\u8fd0\u884c&#xff0c;\u8bbf\u95ee\u5730\u5740: http:\/\/&lt;\u4f60\u7684\u670d\u52a1\u5668IP&gt;:8501&#034;<br \/>\n# \u57288501\u7aef\u53e3\u542f\u52a8Streamlit&#xff0c;\u5e76\u5141\u8bb8\u5916\u90e8\u7f51\u7edc\u8bbf\u95ee<br \/>\nnohup streamlit run app.py &#8211;server.port 8501 &#8211;server.address 0.0.0.0 &gt; streamlit.log 2&gt;&amp;1 &amp;<br \/>\necho &#034;\u542f\u52a8\u547d\u4ee4\u5df2\u6267\u884c\u3002\u67e5\u770b\u65e5\u5fd7: tail -f streamlit.log&#034;<br \/>\nEOF<\/p>\n<p># \u7ed9\u542f\u52a8\u811a\u672c\u6dfb\u52a0\u6267\u884c\u6743\u9650<br \/>\nchmod &#043;x start.sh<\/p>\n<p>\u73b0\u5728&#xff0c;\u6267\u884c\u542f\u52a8\u811a\u672c&#xff01;<\/p>\n<p>.\/start.sh<\/p>\n<p>\u7b2c\u4e00\u6b21\u8fd0\u884c\u4f1a\u52a0\u8f7d\u6a21\u578b&#xff0c;\u53ef\u80fd\u9700\u898130\u79d2\u52301\u5206\u949f&#xff0c;\u5177\u4f53\u53d6\u51b3\u4e8e\u670d\u52a1\u5668\u6027\u80fd\u3002\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u65e5\u5fd7&#xff1a;<\/p>\n<p>\u542f\u52a8 Qwen2.5-1.5B Streamlit \u670d\u52a1&#8230;<br \/>\n\u670d\u52a1\u5c06\u5728\u540e\u53f0\u8fd0\u884c&#xff0c;\u8bbf\u95ee\u5730\u5740: http:\/\/&lt;\u4f60\u7684\u670d\u52a1\u5668IP&gt;:8501<\/p>\n<h4>3.5 \u7b2c\u4e94\u6b65&#xff1a;\u8bbf\u95ee\u4f60\u7684AI\u52a9\u624b<\/h4>\n<p>\u542f\u52a8\u6210\u529f\u540e&#xff0c;\u6253\u5f00\u4f60\u7684\u6d4f\u89c8\u5668&#xff0c;\u8f93\u5165\u4ee5\u4e0b\u5730\u5740&#xff1a;<\/p>\n<p>http:\/\/\u4f60\u7684\u670d\u52a1\u5668\u516c\u7f51IP:8501<\/p>\n<p>\u5982\u679c\u9875\u9762\u6210\u529f\u6253\u5f00&#xff0c;\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u7b80\u6d01\u7684\u804a\u5929\u754c\u9762\u3002\u5728\u5e95\u90e8\u7684\u8f93\u5165\u6846\u91cc&#xff0c;\u5c1d\u8bd5\u95ee\u5b83\u4e00\u4e9b\u95ee\u9898&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<ul>\n<li>\u201c\u7528Python\u5199\u4e00\u4e2a\u5192\u6ce1\u6392\u5e8f\u51fd\u6570\u201d<\/li>\n<li>\u201c\u7ed9\u6211\u63a8\u8350\u51e0\u4e2a\u5317\u4eac\u5468\u672b\u503c\u5f97\u53bb\u7684\u5730\u65b9\u201d<\/li>\n<li>\u201c\u89e3\u91ca\u4e00\u4e0b\u4ec0\u4e48\u662f\u673a\u5668\u5b66\u4e60\u201d<\/li>\n<\/ul>\n<p>\u7a0d\u7b49\u51e0\u79d2&#xff0c;\u5b83\u5c31\u4f1a\u5728\u672c\u5730\u8ba1\u7b97\u51fa\u7b54\u6848&#xff0c;\u5e76\u663e\u793a\u5728\u754c\u9762\u4e0a\u3002<\/p>\n<h3>4. \u4f7f\u7528\u6280\u5de7\u4e0e\u5e38\u89c1\u95ee\u9898<\/h3>\n<h4>4.1 \u8ba9\u5bf9\u8bdd\u66f4\u9ad8\u6548<\/h4>\n<ul>\n<li>\u591a\u8f6e\u5bf9\u8bdd&#xff1a;\u8fd9\u4e2a\u52a9\u624b\u4f1a\u81ea\u52a8\u8bb0\u4f4f\u4f60\u4eec\u4e4b\u524d\u7684\u5bf9\u8bdd\u5185\u5bb9&#xff0c;\u4f60\u53ef\u4ee5\u57fa\u4e8e\u4e0a\u4e00\u8f6e\u7684\u56de\u7b54\u7ee7\u7eed\u8ffd\u95ee&#xff0c;\u4e0a\u4e0b\u6587\u662f\u8fde\u8d2f\u7684\u3002<\/li>\n<li>\u5f00\u59cb\u65b0\u8bdd\u9898&#xff1a;\u5982\u679c\u60f3\u804a\u4e00\u4e2a\u5b8c\u5168\u65e0\u5173\u7684\u65b0\u95ee\u9898&#xff0c;\u70b9\u51fb\u5de6\u4fa7\u8fb9\u680f\u7684 \u201c&#x1f9f9; \u6e05\u7a7a\u5bf9\u8bdd\u5386\u53f2\u201d \u6309\u94ae\u3002\u8fd9\u4e0d\u4ec5\u4f1a\u6e05\u7a7a\u5c4f\u5e55\u4e0a\u7684\u8bb0\u5f55&#xff0c;\u8fd8\u4f1a\u91ca\u653eGPU\u663e\u5b58&#xff08;\u5982\u679c\u4f60\u7528\u4e86GPU\u7684\u8bdd&#xff09;\u3002<\/li>\n<li>\u95ee\u9898\u8981\u5177\u4f53&#xff1a;\u50cf\u201c\u5199\u4e00\u7bc7\u4f5c\u6587\u201d\u8fd9\u6837\u7684\u95ee\u9898\u53ef\u80fd\u8ba9\u6a21\u578b\u4e0d\u77e5\u5982\u4f55\u4e0b\u624b\u3002\u8bd5\u8bd5\u201c\u5199\u4e00\u7bc7\u5173\u4e8e\u6625\u5929\u90ca\u6e38\u7684300\u5b57\u5c0f\u5b66\u751f\u4f5c\u6587\u201d&#xff0c;\u6548\u679c\u4f1a\u597d\u5f88\u591a\u3002<\/li>\n<\/ul>\n<h4>4.2 \u4f60\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898<\/h4>\n<p>1. \u9875\u9762\u6253\u4e0d\u5f00&#xff08;\u8fde\u63a5\u88ab\u62d2\u7edd&#xff09;<\/p>\n<ul>\n<li>\u68c0\u67e5\u9632\u706b\u5899&#xff1a;\u963f\u91cc\u4e91ECS\u9ed8\u8ba4\u6709\u5b89\u5168\u7ec4\u89c4\u5219\u3002\u4f60\u9700\u8981\u767b\u5f55\u963f\u91cc\u4e91\u63a7\u5236\u53f0&#xff0c;\u627e\u5230\u4f60\u7684ECS\u5b9e\u4f8b&#xff0c;\u5728\u5b89\u5168\u7ec4\u8bbe\u7f6e\u4e2d&#xff0c;\u6dfb\u52a0\u5165\u65b9\u5411\u89c4\u5219&#xff0c;\u5141\u8bb8TCP\u534f\u8bae\u4e0b\u76848501\u7aef\u53e3\u3002<\/li>\n<li>\u68c0\u67e5\u670d\u52a1\u662f\u5426\u8fd0\u884c&#xff1a;\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c ps aux | grep streamlit&#xff0c;\u770b\u770b\u8fdb\u7a0b\u662f\u5426\u5b58\u5728\u3002\u5982\u679c\u6ca1\u6709&#xff0c;\u91cd\u65b0\u8fd0\u884c .\/start.sh\u3002<\/li>\n<\/ul>\n<p>2. \u6a21\u578b\u52a0\u8f7d\u5931\u8d25<\/p>\n<ul>\n<li>\u62a5\u9519\u201cNo such file or directory\u201d&#xff1a;\u8bf4\u660eMODEL_PATH\u8bbe\u7f6e\u9519\u4e86\u3002\u8bf7\u6253\u5f00app.py&#xff0c;\u786e\u8ba4\u7b2c10\u884c\u7684MODEL_PATH &#061; &#034;\/root\/qwen1.5b&#034;\u662f\u5426\u4e0e\u4f60\u5b9e\u9645\u5b58\u653e\u6a21\u578b\u7684\u8def\u5f84\u5b8c\u5168\u4e00\u81f4\u3002<\/li>\n<li>\u62a5\u9519\u5173\u4e8e\u201ctransformers\u201d\u7248\u672c&#xff1a;\u8bf7\u786e\u4fdd\u4e25\u683c\u6309\u7167requirements.txt\u5b89\u88c5\u4f9d\u8d56\u3002\u53ef\u4ee5\u5c1d\u8bd5\u5347\u7ea7&#xff1a;pip3 install &#8211;upgrade -r requirements.txt\u3002<\/li>\n<\/ul>\n<p>3. \u56de\u7b54\u901f\u5ea6\u6162<\/p>\n<ul>\n<li>1.5B\u6a21\u578b\u5728CPU\u4e0a\u8fd0\u884c\u786e\u5b9e\u4f1a\u6162\u4e00\u4e9b\u3002\u8fd9\u662f\u6b63\u5e38\u7684\u3002\u5982\u679c\u670d\u52a1\u5668\u6709GPU&#xff08;\u6bd4\u5982NVIDIA T4&#xff09;&#xff0c;\u4ee3\u7801\u4f1a\u81ea\u52a8\u4f7f\u7528GPU&#xff0c;\u901f\u5ea6\u4f1a\u5feb\u5f88\u591a\u3002<\/li>\n<li>\u751f\u6210\u7684\u957f\u5ea6&#xff08;max_new_tokens&#xff09;\u8bbe\u7f6e\u5f97\u8d8a\u5927&#xff0c;\u7b49\u5f85\u65f6\u95f4\u8d8a\u957f\u3002\u5982\u679c\u53ea\u662f\u7b80\u5355\u95ee\u7b54&#xff0c;\u53ef\u4ee5\u5728\u4ee3\u7801\u91cc\u628a\u8fd9\u4e2a\u503c\u8c03\u5c0f&#xff0c;\u6bd4\u5982512\u3002<\/li>\n<\/ul>\n<p>4. \u5982\u4f55\u5173\u95ed\u670d\u52a1 \u5728\u670d\u52a1\u5668\u7ec8\u7aef\u91cc&#xff0c;\u627e\u5230Streamlit\u7684\u8fdb\u7a0bID\u5e76\u7ed3\u675f\u5b83\u3002<\/p>\n<p># \u627e\u5230\u8fdb\u7a0bID<br \/>\nps aux | grep streamlit<br \/>\n# \u7ed3\u675f\u8fdb\u7a0b (\u5047\u8bbePID\u662f12345)<br \/>\nkill 12345<\/p>\n<h3>5. \u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u4e0a\u9762\u8fd9\u51e0\u4e2a\u6b65\u9aa4&#xff0c;\u4f60\u5df2\u7ecf\u6210\u529f\u5728\u963f\u91cc\u4e91ECS\u4e0a\u90e8\u7f72\u4e86\u4e00\u4e2a\u5b8c\u5168\u672c\u5730\u5316\u7684\u3001\u5e26\u6709Web\u754c\u9762\u7684Qwen2.5-1.5B\u667a\u80fd\u5bf9\u8bdd\u52a9\u624b\u3002\u6211\u4eec\u6765\u56de\u987e\u4e00\u4e0b\u5173\u952e\u70b9&#xff1a;<\/p>\n<li>\u6838\u5fc3\u4f18\u52bf&#xff1a;\u9690\u79c1\u5b89\u5168&#xff08;\u6570\u636e\u4e0d\u51fa\u672c\u5730&#xff09;\u3001\u5f00\u7bb1\u5373\u7528&#xff08;\u65e0\u9700\u590d\u6742\u914d\u7f6e&#xff09;\u3001\u8f7b\u91cf\u9ad8\u6548&#xff08;1.5B\u6a21\u578b\u5bf9\u786c\u4ef6\u8981\u6c42\u4f4e&#xff09;\u3002<\/li>\n<li>\u6280\u672f\u8981\u70b9&#xff1a;\u5229\u7528transformers\u5e93\u52a0\u8f7d\u5b98\u65b9\u6a21\u578b&#xff0c;\u7528streamlit\u5feb\u901f\u6784\u5efa\u4ea4\u4e92\u754c\u9762&#xff0c;\u901a\u8fc7device_map&#061;\u201cauto\u201d\u5b9e\u73b0\u786c\u4ef6\u81ea\u52a8\u9002\u914d\u3002<\/li>\n<li>\u4f7f\u7528\u4f53\u9a8c&#xff1a;\u4f60\u83b7\u5f97\u4e86\u4e00\u4e2a\u901a\u8fc7\u6d4f\u89c8\u5668\u5373\u53ef\u8bbf\u95ee\u7684\u79c1\u6709ChatGPT\u5f0f\u5de5\u5177&#xff0c;\u652f\u6301\u591a\u8f6e\u5bf9\u8bdd&#xff0c;\u6ee1\u8db3\u65e5\u5e38\u95ee\u7b54\u3001\u6587\u6848\u8f85\u52a9\u3001\u4ee3\u7801\u54a8\u8be2\u7b49\u9700\u6c42\u3002<\/li>\n<p>\u8fd9\u4e2a\u9879\u76ee\u5c31\u50cf\u4e00\u4e2a\u79cd\u5b50&#xff0c;\u4f60\u5b8c\u5168\u53ef\u4ee5\u57fa\u4e8e\u5b83\u505a\u66f4\u591a\u4e8b\u60c5&#xff1a;<\/p>\n<ul>\n<li>\u66f4\u6362\u6a21\u578b&#xff1a;\u628aMODEL_PATH\u6307\u5411\u66f4\u5927\u7684Qwen\u6a21\u578b&#xff08;\u59827B\u300114B&#xff09;&#xff0c;\u83b7\u5f97\u66f4\u5f3a\u7684\u80fd\u529b&#xff08;\u9700\u8981\u66f4\u591a\u663e\u5b58&#xff09;\u3002<\/li>\n<li>\u7f8e\u5316\u754c\u9762&#xff1a;Streamlit\u652f\u6301\u5f88\u591a\u7ec4\u4ef6&#xff0c;\u4f60\u53ef\u4ee5\u589e\u52a0\u5386\u53f2\u5bf9\u8bdd\u4fdd\u5b58\u3001\u8bed\u97f3\u8f93\u5165\u8f93\u51fa\u3001\u4e3b\u9898\u5207\u6362\u7b49\u529f\u80fd\u3002<\/li>\n<li>\u96c6\u6210\u5e94\u7528&#xff1a;\u5c06\u8fd9\u4e2a\u5bf9\u8bdd\u80fd\u529b\u4f5c\u4e3a\u540e\u7aefAPI&#xff0c;\u4e3a\u4f60\u81ea\u5df1\u7684\u7f51\u7ad9\u6216\u5e94\u7528\u63d0\u4f9bAI\u670d\u52a1\u3002<\/li>\n<\/ul>\n<p>\u5e0c\u671b\u8fd9\u4e2a\u6559\u7a0b\u80fd\u5e2e\u4f60\u8f7b\u677e\u8e0f\u51fa\u5927\u6a21\u578b\u672c\u5730\u90e8\u7f72\u7684\u7b2c\u4e00\u6b65\u3002\u52a8\u624b\u8bd5\u8bd5\u5427&#xff0c;\u611f\u53d7\u4e00\u4e0b\u5728\u4f60\u81ea\u5df1\u670d\u52a1\u5668\u4e0a\u8fd0\u884cAI\u7684\u4e50\u8da3\u3002<\/p>\n<hr \/>\n<p>\u83b7\u53d6\u66f4\u591aAI\u955c\u50cf<\/p>\n<p>\u60f3\u63a2\u7d22\u66f4\u591aAI\u955c\u50cf\u548c\u5e94\u7528\u573a\u666f&#xff1f;\u8bbf\u95ee CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u7f6e\u955c\u50cf&#xff0c;\u8986\u76d6\u5927\u6a21\u578b\u63a8\u7406\u3001\u56fe\u50cf\u751f\u6210\u3001\u89c6\u9891\u751f\u6210\u3001\u6a21\u578b\u5fae\u8c03\u7b49\u591a\u4e2a\u9886\u57df&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b&#xff1a;\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab<br \/>\n1. \u5b66\u4e60\u76ee\u6807\u4e0e\u9879\u76ee\u4ef7\u503c<br \/>\n\u4f60\u662f\u4e0d\u662f\u4e5f\u60f3\u5728\u672c\u5730\u642d\u5efa\u4e00\u4e2a\u5c5e\u4e8e\u81ea\u5df1\u7684AI\u5bf9\u8bdd\u52a9\u624b&#xff0c;\u4f46\u53c8\u62c5\u5fc3\u6280\u672f\u95e8\u69db\u592a\u9ad8\u3001\u914d\u7f6e\u592a\u590d\u6742&#xff1f;\u4eca\u5929&#xff0c;\u6211\u5c31\u5e26\u4f60\u752810\u5206\u949f\u65f6\u95f4&#xff0c;\u5728\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e0a&#xff0c;\u628a\u963f\u91cc\u901a\u4e49\u5343\u95ee\u7684\u8f7b\u91cf\u7ea7\u5927\u6a21\u578bQwen2.5-1.5B\u8dd1\u8d77\u6765&#xff0c;\u5e76\u7ed9\u5b83\u914d\u4e0a\u4e00\u4e2a\u6f02\u4eae\u7684\u7f51\u9875\u804a\u5929\u754c\u9762\u3002<br \/>\n\u8fd9\u4e2a\u9879\u76ee\u6700\u5927\u7684\u7279\u70b9<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9987,956,603],"topic":[],"class_list":["post-88129","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-956","tag-603"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/88129.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b&#xff1a;\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab 1. \u5b66\u4e60\u76ee\u6807\u4e0e\u9879\u76ee\u4ef7\u503c \u4f60\u662f\u4e0d\u662f\u4e5f\u60f3\u5728\u672c\u5730\u642d\u5efa\u4e00\u4e2a\u5c5e\u4e8e\u81ea\u5df1\u7684AI\u5bf9\u8bdd\u52a9\u624b&#xff0c;\u4f46\u53c8\u62c5\u5fc3\u6280\u672f\u95e8\u69db\u592a\u9ad8\u3001\u914d\u7f6e\u592a\u590d\u6742&#xff1f;\u4eca\u5929&#xff0c;\u6211\u5c31\u5e26\u4f60\u752810\u5206\u949f\u65f6\u95f4&#xff0c;\u5728\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e0a&#xff0c;\u628a\u963f\u91cc\u901a\u4e49\u5343\u95ee\u7684\u8f7b\u91cf\u7ea7\u5927\u6a21\u578bQwen2.5-1.5B\u8dd1\u8d77\u6765&#xff0c;\u5e76\u7ed9\u5b83\u914d\u4e0a\u4e00\u4e2a\u6f02\u4eae\u7684\u7f51\u9875\u804a\u5929\u754c\u9762\u3002 \u8fd9\u4e2a\u9879\u76ee\u6700\u5927\u7684\u7279\u70b9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/88129.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-31T07:24:58+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88129.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/88129.html\",\"name\":\"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-31T07:24:58+00:00\",\"dateModified\":\"2026-07-31T07:24:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/88129.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/88129.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88129.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/88129.html","og_locale":"zh_CN","og_type":"article","og_title":"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b&#xff1a;\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab 1. \u5b66\u4e60\u76ee\u6807\u4e0e\u9879\u76ee\u4ef7\u503c \u4f60\u662f\u4e0d\u662f\u4e5f\u60f3\u5728\u672c\u5730\u642d\u5efa\u4e00\u4e2a\u5c5e\u4e8e\u81ea\u5df1\u7684AI\u5bf9\u8bdd\u52a9\u624b&#xff0c;\u4f46\u53c8\u62c5\u5fc3\u6280\u672f\u95e8\u69db\u592a\u9ad8\u3001\u914d\u7f6e\u592a\u590d\u6742&#xff1f;\u4eca\u5929&#xff0c;\u6211\u5c31\u5e26\u4f60\u752810\u5206\u949f\u65f6\u95f4&#xff0c;\u5728\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e0a&#xff0c;\u628a\u963f\u91cc\u901a\u4e49\u5343\u95ee\u7684\u8f7b\u91cf\u7ea7\u5927\u6a21\u578bQwen2.5-1.5B\u8dd1\u8d77\u6765&#xff0c;\u5e76\u7ed9\u5b83\u914d\u4e0a\u4e00\u4e2a\u6f02\u4eae\u7684\u7f51\u9875\u804a\u5929\u754c\u9762\u3002 \u8fd9\u4e2a\u9879\u76ee\u6700\u5927\u7684\u7279\u70b9","og_url":"https:\/\/www.wsisp.com\/helps\/88129.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-31T07:24:58+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/88129.html","url":"https:\/\/www.wsisp.com\/helps\/88129.html","name":"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-31T07:24:58+00:00","dateModified":"2026-07-31T07:24:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/88129.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/88129.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/88129.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Qwen2.5-1.5B Streamlit\u90e8\u7f72\u6559\u7a0b\uff1a\u963f\u91cc\u4e91ECS\u8f7b\u91cf\u670d\u52a1\u5668\u4e00\u952e\u90e8\u7f72\u811a\u672c\u5206\u4eab"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=88129"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88129\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=88129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=88129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=88129"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=88129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}