Spaces:
Runtime error
Runtime error
Update llm_preprocess.py
Browse files- llm_preprocess.py +4 -1
llm_preprocess.py
CHANGED
|
@@ -4,6 +4,8 @@ At the command line, only need to run once to install the package via pip:
|
|
| 4 |
$ pip install google-generativeai
|
| 5 |
"""
|
| 6 |
import json
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def get_event():
|
| 9 |
event_list = [
|
|
@@ -60,7 +62,8 @@ def postprocess(caption):
|
|
| 60 |
def preprocess_gemini(free_text_caption):
|
| 61 |
preffix_prompt = get_prompt()
|
| 62 |
import google.generativeai as genai
|
| 63 |
-
|
|
|
|
| 64 |
|
| 65 |
# Set up the model
|
| 66 |
generation_config = {
|
|
|
|
| 4 |
$ pip install google-generativeai
|
| 5 |
"""
|
| 6 |
import json
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
|
| 10 |
def get_event():
|
| 11 |
event_list = [
|
|
|
|
| 62 |
def preprocess_gemini(free_text_caption):
|
| 63 |
preffix_prompt = get_prompt()
|
| 64 |
import google.generativeai as genai
|
| 65 |
+
GEMINI_API_KEY = os.environ["GEMINI_API_KEY"]
|
| 66 |
+
genai.configure(api_key=GEMINI_API_KEY)
|
| 67 |
|
| 68 |
# Set up the model
|
| 69 |
generation_config = {
|