MKE0108 commited on
Commit
75a95c8
·
verified ·
1 Parent(s): ff37a0c

Update bot_main.py

Browse files
Files changed (1) hide show
  1. bot_main.py +3 -3
bot_main.py CHANGED
@@ -135,7 +135,7 @@ model = genai.GenerativeModel("gemini-pro", safety_settings=safety_settings)
135
  import random
136
  import asyncio
137
 
138
- async def generate_content1(topic):
139
  base = [
140
  "我從不覺得在___快樂過",
141
  "一但加入了___就再也回不去了",
@@ -159,7 +159,7 @@ async def generate_content1(topic):
159
 
160
  # Simulating an asynchronous API call to the model
161
  model = genai.GenerativeModel("gemini-1.5-flash")
162
- response = await model.generate_content(prompt)
163
 
164
  # Assuming response.candidates is iterable and contains a 'content' attribute
165
  for candidate in response.candidates:
@@ -171,7 +171,7 @@ async def generate_content1(topic):
171
  async def create_bad_message(topic, n=10):
172
  result = []
173
  for i in range(n):
174
- result = await generate_content1(topic)
175
  if result is not None:
176
  return result
177
  return "為什麼要演奏春日影?"
 
135
  import random
136
  import asyncio
137
 
138
+ def generate_content1(topic):
139
  base = [
140
  "我從不覺得在___快樂過",
141
  "一但加入了___就再也回不去了",
 
159
 
160
  # Simulating an asynchronous API call to the model
161
  model = genai.GenerativeModel("gemini-1.5-flash")
162
+ response = model.generate_content(prompt)
163
 
164
  # Assuming response.candidates is iterable and contains a 'content' attribute
165
  for candidate in response.candidates:
 
171
  async def create_bad_message(topic, n=10):
172
  result = []
173
  for i in range(n):
174
+ result = generate_content1(topic)
175
  if result is not None:
176
  return result
177
  return "為什麼要演奏春日影?"