Package: qwen7b-tr
qwen7b-trTranslate/Chat using a qwen-7b-chat API at huggingfaceInstall itpipinstallqwen7b-tr--upgrade# pip install git+https://github.com/ffreemt/qwen7b-tr# poetry add git+https://github.com/ffreemt/qwen7b-tr# git clone https://github.com/ffreemt/qwen7b-tr && cd qwen7b-trUse itfromqwen7b_tr.__main__importqwen7b_tr# This is in fact just chat with the qwen-7b-chat modelprint(qwen7b_tr("你好"))# 你好！有什么我能帮助你的吗？From command linepython -m qwen7b_tr test abc
# or qwen7b-tr test abc三个版本如下：1.测试abc2.ABC测试3.三号测试ABCIf no text is provided, the content of the clipboard will be used.python -m qwen7b_tr# Assume the clipboard contains `available`Notextprovided,translatingthecontentoftheclipboard...diggin...
LoadedasAPI:https://mikeee-qwen-7b-chat.hf.space/✔

available

以下是三个不同的中文版本：1.可用的2.可获得的3.有效的Target language can be specified with -tpython -m qwen7b_tr -t 德语No text provided, translating the content of the clipboard...
        diggin...
Loaded as API: https://mikeee-qwen-7b-chat.hf.space/ ✔

available

1. "Verfügbare"
  2. "Sollte"
  3. "Da ist"python -m qwen7b_tr -t 英语 我国服务贸易“朋友圈”日益扩大
        diggin...
Loaded as API: https://mikeee-qwen-7b-chat.hf.space/ ✔

我国服务贸易“朋友圈”日益扩大

1. China's circle of service trade friends is expanding.
  2. The circle of China's service trade partners is growing larger.
  3. China's circle of service trade acquaintances is increasing.Help and Manualpython -m qwen7b_tr --help

# or
qwen7b-tr --helpUsage:python-mqwen7b_tr[OPTIONS][QUESTION]...Translateviaqwen-7b-chathuggingfaceAPI.

Arguments:[QUESTION]...Sourcetextorquestion.

Options:-c,--clipbUseclipboardcontentifsetorif`question`isempty.-t,--to-langTEXTTargetlanguagewhenusingthedefaultprompt.[default:中文]-n,--numbINTEGERnumberoftranslationvariantswhenusingthedefaultprompt.[default3]-m,--max-new-tokensINTEGERMaxnewtokens.[default:256]--temperature,--tempINTEGERTemperature.[default:0.81]--repetition-penalty,--repFLOATRepetitionpenalty.[default:1.1]--top-k,--top_kINTEGERTop_k.[default:0]--top-p,--top_pFLOATTop_p.[default:0.9]--user-promptTEXTUserprompt.[default:'翻成中文，列出3个版本.']-p,--system-promptTEXTUserdefinedsystemprompt.[default:'Youare a helpful assistant.']-v,-V,--versionShowversioninfoandexit.--helpShowthismessageandexit.More Examplestemperature# default temperature 0.81
python -m qwen7b_tr marketing is critical to ensure fan interest remains high

1. 营销对于确保粉丝的兴趣保持高水平至关重要。
2. 市场营销对于维持粉丝的兴趣至关重要。
3. 粉丝的兴趣水平需要通过有效的市场营销来保持。# a high temperature reuslts in a versatile outcome
python -m qwen7b_tr --temp 1.1 marketing is critical to ensure fan interest remains high

1. 营销至关重要，以确保球迷的兴趣继续保持高水平。
2. 营销工作是至关重要的，以保持球迷的兴趣。
3. 推广是保持球迷关注度的关键。A very high temperature (for example 1.5) may result in  some nonsensical output.-n: number of translation variantsIf you wish to have more choices, for example 5 variantspython -m qwen7b_tr -n 5 marketing campaign companion

  1. 营销活动伙伴
  2. 市场营销活动伴侣
  3. 营销活动助手
  4. 市场营销活动支持者
  5. 营销活动协作者max new tokensThe defaultmax_new_tokensis 256, sutiable for chatting. If you translate a large chunk of text. you may wish to setmax_new_tokensto 1024.python -m qwen7b_tr --max-new-tokens 1024 blah blah ...Develop and Debugset LOGURU_LEVEL=TRACE

# or in linux
export LOGURU_LEVEL=TRACEto see a lot of debug messages