clue-ai / clueai-python Goto Github PK
View Code? Open in Web Editor NEWclueai工具包: 3行代码3分钟,自定义需要的API!
Home Page: https://www.clueai.cn
License: MIT License
clueai工具包: 3行代码3分钟,自定义需要的API!
Home Page: https://www.clueai.cn
License: MIT License
已经成功上传了微调数据,调用训练好的微调模型也是成功的,但是结果不是微调预期的结果。
上传的json内容如下:
{"id": 1, "type": "qa", "question": "用户:闵行区图书馆地址是?\n小元:", "answer": "闵行区名都路85号"}
{"id": 2, "type": "qa", "question": "用户:开放时间是\n小元:", "answer": "平日开放时间:【一楼】借还处\n周二至周日 9:00–20:00\n办证处\n周二至周日 9:00–16:00\n报刊阅览室\n 周一 12:00–17:00\n 周二至周日 9:00–20:00\n城市书房闵图馆\n周一至周日 9:00–17:00"}
然后测试微调结果代码如下:
response = cl.start_finetune_model(
engine_key=engine_key,
base_model_name="ChatYuan")
print(response)
prompt= '''用户:闵行区图书馆地址是
小元:'''
prediction = cl.finetune_generate(
engine_key=engine_key,
base_model_name='ChatYuan',
prompt=prompt)
result = prediction.generations[0].text
返回的结果跟不使用微调模型相比,没有变化
Traceback (most recent call last):
File "D:\Python311\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python311\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python311\Lib\runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python311\Lib\runpy.py", line 88, in _run_code
exec(code, run_globals)
File "c:\Users\dongy\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module>
cli.main()
File "c:\Users\dongy\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\dongy\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "c:\Users\dongy\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\dongy\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "c:\Users\dongy\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "F:\ShiZiAngA\usage.py", line 6, in <module>
clue = cl.check_usage(finetune_user=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python311\Lib\site-packages\clueai\client.py", line 130, in check_usage
return res.json()
^^^^^^^^^^
File "D:\Python311\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
clueapi 微调,返回engine key 后 显示:还未完成训练,请稍后:{'state': True, 'finished': False}
如果是云端的api 这个收费的化还真不如本地的
RT
1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.