kimpudding commited on
Commit
eb6f7a4
Β·
verified Β·
1 Parent(s): 9225d17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -24,12 +24,10 @@ def generate_response(user_prompt):
24
  'jsonl 파일의 양식은 λ‹€μŒκ³Ό κ°™μ•„: {"Description": "000", "Etymology": "000", "Etymology.Type": "000", "Name": "000", "Magic": "000", "KeySentence": "000", "Body color": "[Hue: 00.0, Saturation: 0.00, Value: 0.00]", "Hair style": "000", "Hair color": "[Hue: 00.0, Saturation: 0.00, Value: 0.00]","Hand-held item": "000", "Hand-held item color": "[Hue: 00.0, Saturation: 0.00, Value: 0.00]"}'
25
  )},
26
  {"role": "user", "content": user_prompt}
27
- ],
28
- max_tokens=2048,
29
- temperature=0.8
30
  )
31
  # ChatCompletion 응닡 ν…μŠ€νŠΈ λ°˜ν™˜
32
- return response['choices'][0]['message']['content'].strip()
33
  except openai.OpenAIError as e:
34
  # OpenAI κ΄€λ ¨ μ—λŸ¬ 처리
35
  return f"OpenAI API 였λ₯˜: {str(e)}"
@@ -50,6 +48,7 @@ interface = gr.Interface(
50
  theme="compact" # Gradio μΈν„°νŽ˜μ΄μŠ€μ˜ ν…Œλ§ˆ μ„€μ •
51
  )
52
 
 
53
  # μ•± μ‹€ν–‰
54
  if __name__ == "__main__":
55
  interface.launch(server_name="0.0.0.0", server_port=int(os.getenv("PORT", 7860)))
 
24
  'jsonl 파일의 양식은 λ‹€μŒκ³Ό κ°™μ•„: {"Description": "000", "Etymology": "000", "Etymology.Type": "000", "Name": "000", "Magic": "000", "KeySentence": "000", "Body color": "[Hue: 00.0, Saturation: 0.00, Value: 0.00]", "Hair style": "000", "Hair color": "[Hue: 00.0, Saturation: 0.00, Value: 0.00]","Hand-held item": "000", "Hand-held item color": "[Hue: 00.0, Saturation: 0.00, Value: 0.00]"}'
25
  )},
26
  {"role": "user", "content": user_prompt}
27
+ ]
 
 
28
  )
29
  # ChatCompletion 응닡 ν…μŠ€νŠΈ λ°˜ν™˜
30
+ return response["choices"][0]["message"]["content"].strip()
31
  except openai.OpenAIError as e:
32
  # OpenAI κ΄€λ ¨ μ—λŸ¬ 처리
33
  return f"OpenAI API 였λ₯˜: {str(e)}"
 
48
  theme="compact" # Gradio μΈν„°νŽ˜μ΄μŠ€μ˜ ν…Œλ§ˆ μ„€μ •
49
  )
50
 
51
+
52
  # μ•± μ‹€ν–‰
53
  if __name__ == "__main__":
54
  interface.launch(server_name="0.0.0.0", server_port=int(os.getenv("PORT", 7860)))