Spaces:
Runtime error
Runtime error
翻译prompt
Browse files61 unmodified lines626364656667216 unmodified lines28428528628728828929029129229361 unmodified linesseed = random.randint(0, MAX_SEED)return seed@spaces.GPUdef generate(216 unmodified lines).then(fn=generate,inputs=[prompt,negative_prompt,prompt_2,negative_prompt_2,use_negative_prompt,use_prompt_2,use_negative_prompt_2,61 unmodified lines6263646566676869707172737475767778798081216 unmodified lines29829930030130230330430530630761 unmodified linesseed = random.randint(0, MAX_SEED)return seeddef translateEN(zh):result = requests.post("https://api-free.deepl.com/v2/translate",params={"auth_key": "e8b4d428-ada5-3f8d-f965-bad01e8a06c1:fx","target_lang": "EN-US","text": zh})return result.json()["translations"][0]["text"]def process_text(prompt):print("中文提示词: \n", prompt)prompt_trans = translateEN(prompt)print("prompt: \n", prompt_trans)return prompt_trans@spaces.GPUdef generate(216 unmodified lines).then(fn=generate,inputs=[process_text(prompt),process_text(negative_prompt),process_text(prompt_2),process_text(negative_prompt_2),use_negative_prompt,use_prompt_2,use_negative_prompt_2,
app.py+18-4