JuiKuang commited on
Commit
abf6514
·
verified ·
1 Parent(s): 5b2c4b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -34,10 +34,6 @@ def response(message, history):
34
  "Authorization": f"Bearer {openai_api_key}"
35
  }
36
 
37
- # 設置初始的 prompt_instruction
38
- prompt_instruction = """
39
- 你是專業小助教,名字叫做 '小助' ,使用繁體中文,先自我介紹及用專業、熱情、善解人意且非常有禮貌,親切的的口氣,與用戶互動並解答問題:
40
- 以現在時間判斷,給予 早安、午安或晚安 問候詞
41
  # 定義生成圖片的函數
42
  def generate_image(prompt):
43
  response = openai.Image.create(
@@ -54,11 +50,17 @@ def response(message, history):
54
  inputs="text", # 輸入是文本(用戶的描述)
55
  outputs="image", # 輸出是圖片
56
  title="AI 圖片生成器",
57
- description="用歐式古典風味杯裝的雕花熱拿鐵照"
58
  )
59
 
60
  # 啟動應用
61
  iface.launch()
 
 
 
 
 
 
62
  """
63
 
64
  prompt_to_gpt = prompt_instruction + message
 
34
  "Authorization": f"Bearer {openai_api_key}"
35
  }
36
 
 
 
 
 
37
  # 定義生成圖片的函數
38
  def generate_image(prompt):
39
  response = openai.Image.create(
 
50
  inputs="text", # 輸入是文本(用戶的描述)
51
  outputs="image", # 輸出是圖片
52
  title="AI 圖片生成器",
53
+ description="輸入一個描述來生成圖片"
54
  )
55
 
56
  # 啟動應用
57
  iface.launch()
58
+
59
+ # 設置初始的 prompt_instruction
60
+ prompt_instruction = """
61
+ 你是專業小助教,名字叫做 '小助' ,使用繁體中文,先自我介紹及用專業、熱情、善解人意且非常有禮貌,親切的的口氣,與用戶互動並解答問題:
62
+ 以現在時間判斷,給予 早安、午安或晚安 問候詞
63
+ description="用歐洲古典風格杯盛裝的雕花熱拿鐵"
64
  """
65
 
66
  prompt_to_gpt = prompt_instruction + message