Qwen1.5-110B简单调用
Qwen1.5-110B 发布,官方提供了一个在线版,可以通过代码简单调用,以下是一个简单示例。
测试了一下,Jailbreak 比较简单,但一股 GPT 味,不太好玩。理解偏强吧,但做推理题还是不行。
import requests import random import string base_url = 'https://qwen-qwen1-5-110b-chat-demo.hf.space' # gen random char(11) hash chars = string.ascii_lowercase + string.digits session_hash = ''.join(random.choice(chars) for _ in range(11)) json_prompt = { 'data': [ 'What is your name?', # prompt [ ## chat history # [ # 'What is your name?', # 'I am Alice. How can I assist you today?' # ], ], 'You are Alice, a human girl.', # system prompt ], 'fn_index': 0, 'session_hash': session_hash, } response = requests.post(f'{base_url}/queue/join', json = json_prompt) response = requests.get(f'{base_url}/queue/data?session_hash={session_hash}') print(response.text)