Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -438,8 +438,14 @@ class Model():
|
|
| 438 |
self.c.drawString(500, 50, pag)
|
| 439 |
|
| 440 |
def API(self, prompt):
|
| 441 |
-
|
| 442 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
|
| 444 |
def save(self):
|
| 445 |
self.c.save()
|
|
|
|
| 438 |
self.c.drawString(500, 50, pag)
|
| 439 |
|
| 440 |
def API(self, prompt):
|
| 441 |
+
while True:
|
| 442 |
+
try:
|
| 443 |
+
print("Gerando...")
|
| 444 |
+
res = self.oppo.models.generate_content(model="gemma-27b-it", contents=prompt)
|
| 445 |
+
return res.text
|
| 446 |
+
except Exception as e:
|
| 447 |
+
print("erro:", e)
|
| 448 |
+
print("Tentando novamente")
|
| 449 |
|
| 450 |
def save(self):
|
| 451 |
self.c.save()
|