Sky Chu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Ollama 基本指令: -- ollama pull llama2:70b 拉一個模型回來 -- ollama run llama2:70b 啟動一個模型(互動介面) -- ollama rm llama2:70b 刪除模型 -- ollama cp llama2:70bh my-llama2 複製一個模型 -- ollama list 目前主機上已經擁有的模型列表 -- ollama create {model_name} -f ./Modelfile 建立自己的 modelfile 裡面會寫 prompt 或是一些相關參數調整 -- ollama run llama2 "Summarize this file: $(cat README.md)" 傳入 prompt -- ollama serve 啟動一個伺服器。 Linux 安装:% curl https://ollama.ai/install.sh | sh — ollama pull llama2-chinese — ollama run llama2-chinese "天空为什么是蓝色的?" Ollama WebUI If Ollama is on your computer, use this command: docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main If Ollama is on a Different Server, use this command: docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=https://example.com/api -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main # 與模型聊天 curl http://localhost:11434/api/chat -d '{"model": "mistral","messages": [{ "role": "user", "content": "why is the sky blue?" }]}' curl http://10.221.253.56:11434/api/chat -d '{"model": "mistral","messages": [{ "role": "user", "content": "why is the sky blue?" }]}' curl http://10.221.253.65:11434/api/chat -d '{"model": "mistral","messages": [{ "role": "user", "content": "why is the sky blue?" }]}' 安裝Docker 先更新Ubuntu,輸入apt-get update。 再輸入apt-get upgrade。 在Ubuntu的終端機視窗中,輸入 curl -sSL https://get.docker.com/ubuntu/ | sudo sh 檢驗Docker是否安裝成功 輸入docker info # Using_llama2_faiss_and_langchain_for_question_answering_on_your_own_data.ipynb https://github.com/langchain-ai/langchain https://github.com/chatchat-space/Langchain-Chatchat/blob/master/img/langchain+chatglm.png https://github.com/huggingface/transformers https://github.com/facebookresearch/faiss https://github.com/murtuza753/llama2-faiss-langchain-qa-rag/blob/main/Using_llama2_faiss_and_langchain_for_question_answering_on_your_own_data.ipynb `OLLAMA_HOST=127.0.0.1:11435 ollama serve` 可以改port # GPT Crawler `git clone https://github.com/BuilderIO/gpt-crawler.git` `cd gpt-crawler/containerapp` //切到這個path ## 視情況更改config (all return Config Version) ```yaml import { Config } from "./src/config"; export const defaultConfig: Config = { url: "https://www.vghtpe.gov.tw/Index.action",//主頁 match: "https://www.vghtpe.gov.tw/**",//讓他可以去選 maxPagesToCrawl: 50, outputFileName: "../data/output.json", }; ``` 設定完之後 就可以開腳本 `. ./run.sh` ### 有可能遇到的問題 找不到他指定的ubuntu 不能選自己的 所以要預先去pull他指定的image `docker pull ubuntu:jammy ` ## Only News Version config ``` import { Config } from "./src/config"; export const defaultConfig: Config = { url: "https://www.vghtpe.gov.tw/Index.action", match: "https://www.vghtpe.gov.tw/News!one.action?nid=*", maxPagesToCrawl: 50, outputFileName: "../data/output.json", }; ``` # Hugging Face Model [ICD10 model](https://huggingface.co/AkshatSurolia/ICD-10-Code-Prediction?text=Pneumonia) ![image](https://hackmd.io/_uploads/Bk81D2rT6.png) ![image](https://hackmd.io/_uploads/By5swhBTa.png) ![image](https://hackmd.io/_uploads/S18hD3HTa.png) ![image](https://hackmd.io/_uploads/Byml_2rT6.png) ![image](https://hackmd.io/_uploads/rJw3YhBTp.png) ## 弊端: 醫生的描述如果不大吻合的話就找不到 差不多的話就能透過hugging face的model找到接近ICD Code # ChatOllama0606更新 /Users/lin/chat-ollama0606/composables/useMenus.ts 這個可以改Menu的排列 或者蓋掉 參考bdc version /Users/lin/chat-ollama0606/pages/index.vue 要把index.vue裡的改成/pages/chat/index.vue的內容 可以使入首頁就為聊天畫面 /Users/lin/chat-ollama0606/locales/zh-TW.json 這裡要新增zh-TW.json,以便中文化 json檔準備好後 改config /Users/lin/chat-ollama0606/config/i18n.ts /Users/lin/chat-ollama0606/config/index.ts改名稱 --- # 量化model ``` link = https://medium.com/@NeroHin/將-huggingface-格式模式轉換為-gguf-以inx-text-bailong-instruct-7b-為例-a2cfdd892cbc ``` from huggingface_hub import snapshot_download model_id = "INX-TEXT/Bailong-instruct-7B" # hugginFace's model name snapshot_download( repo_id=model_id, local_dir="INX-TEXT_Bailong-instruct-7B", local_dir_use_symlinks=False, revision="main", use_auth_token="<YOUR_HF_ACCESS_TOKEN>") ``` ``` git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp pip install -r requirements.txt ``` python convert.py -h # 複製剛剛下載 HF Model 的 path python convert.py INX-TEXT_Bailong-instruct-7B \ --outfile bailong-instruct-7b-f16.gguf \ --outtype f16 # 以 Q5_K_M 為例 # cd llama.cpp ./quantize ./models/Bailong-instruct-7B-f16.gguf ./models/Bailong-instruct-7B-v0.1-Q5_K_M.gguf q5_k_m from huggingface_hub import HfApi import os api = HfApi() HF_ACCESS_TOKEN = "<YOUR_HF_WRITE_ACCESS_TOKEN>" model_id = "NeroUCH/Bailong-instruct-7B-GGUF" api.create_repo( model_id, exist_ok=True, repo_type="model", # 上傳格式為模型 use_auth_token=HF_ACCESS_TOKEN, ) # upload the model to the hub # upload model name includes the Bailong-instruct-7B in same folder for file in os.listdir(): if file.endswith(".gguf"): model_name = file.lower() api.upload_file( repo_id=model_id, path_in_repo=model_name, path_or_fileobj=f"{os.getcwd()}/{file}", repo_type="model", # 上傳格式為模型 use_auth_token=HF_ACCESS_TOKE) ``` ### conda [conda](https://medium.com/@scofield44165/ubuntu-20-04中安裝-解安裝anaconda及虛擬環境詳細過程-install-uninstall-environment-setup-for-anaconda-in-ubuntu-cd64e68335c5)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully