Update ff.py
Browse files
ff.py
CHANGED
|
@@ -4,10 +4,13 @@ import math as matha
|
|
| 4 |
from g4f.Provider import (
|
| 5 |
Bard)
|
| 6 |
import g4f
|
| 7 |
-
|
| 8 |
import os
|
| 9 |
token=os.environ.get("TOKEN")
|
| 10 |
toto = os.environ.get("BARD")
|
|
|
|
|
|
|
|
|
|
| 11 |
import google.generativeai as genai
|
| 12 |
|
| 13 |
genai.configure(
|
|
@@ -271,10 +274,11 @@ def mariam_chimi(chi,im):
|
|
| 271 |
else:
|
| 272 |
with open(im.name, 'rb') as f:
|
| 273 |
image_data = f.read()
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
|
|
|
| 278 |
|
| 279 |
|
| 280 |
#fin
|
|
|
|
| 4 |
from g4f.Provider import (
|
| 5 |
Bard)
|
| 6 |
import g4f
|
| 7 |
+
from bardapi import Bard as Bd
|
| 8 |
import os
|
| 9 |
token=os.environ.get("TOKEN")
|
| 10 |
toto = os.environ.get("BARD")
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
bard = Bd(token=toto)
|
| 14 |
import google.generativeai as genai
|
| 15 |
|
| 16 |
genai.configure(
|
|
|
|
| 274 |
else:
|
| 275 |
with open(im.name, 'rb') as f:
|
| 276 |
image_data = f.read()
|
| 277 |
+
bard_answer = bard.ask_about_image(chi, image)
|
| 278 |
+
print(bard_answer['content'])
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
return bard_answer['content']
|
| 282 |
|
| 283 |
|
| 284 |
#fin
|