Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -39,6 +39,11 @@ import google.generativeai as genai
|
|
| 39 |
imgur_client_id = os.environ.get('IMGUR_CLIENT_ID')
|
| 40 |
imgur_client = pyimgur.Imgur(imgur_client_id)
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')
|
| 43 |
genai.configure(api_key=GOOGLE_API_KEY)
|
| 44 |
model = genai.GenerativeModel('gemini-2.0-flash')
|
|
|
|
| 39 |
imgur_client_id = os.environ.get('IMGUR_CLIENT_ID')
|
| 40 |
imgur_client = pyimgur.Imgur(imgur_client_id)
|
| 41 |
|
| 42 |
+
# 下面一段是測試是否imgur會檔huggingface space,測試完可刪除
|
| 43 |
+
uploaded_image = imgur_client.upload("/code/mi.png")
|
| 44 |
+
app.logger.info(uploaded_image.link)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')
|
| 48 |
genai.configure(api_key=GOOGLE_API_KEY)
|
| 49 |
model = genai.GenerativeModel('gemini-2.0-flash')
|