Update app.py
Browse files
app.py
CHANGED
@@ -41,10 +41,12 @@ generation_model = GenerativeModel(config.model)
|
|
41 |
|
42 |
def invoke(prompt):
|
43 |
#completion = generation_model.predict(prompt = prompt).text
|
44 |
-
completion = generation_model.generate_content(prompt, stream = False).text
|
|
|
|
|
45 |
wandb.log({"prompt": prompt, "completion": completion})
|
46 |
return completion
|
47 |
-
|
48 |
|
49 |
description = """<a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://cloud.google.com/vertex-ai?hl=en/'>Google Vertex AI</a> API
|
50 |
with <s>text-bison@001</s> gemini-pro foundation model. Model performance evaluation via <a href='https://wandb.ai/bstraehle'>Weights & Biases</a>."""
|
|
|
41 |
|
42 |
def invoke(prompt):
|
43 |
#completion = generation_model.predict(prompt = prompt).text
|
44 |
+
#completion = generation_model.generate_content(prompt, stream = False).text
|
45 |
+
print(generation_model.generate_content(prompt))
|
46 |
+
print(generation_model.generate_content(prompt).text)
|
47 |
wandb.log({"prompt": prompt, "completion": completion})
|
48 |
return completion
|
49 |
+
return "Execution is commented out, but you can view the code at https://huggingface.co/spaces/bstraehle/google-vertex-ai-llm/tree/main."
|
50 |
|
51 |
description = """<a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://cloud.google.com/vertex-ai?hl=en/'>Google Vertex AI</a> API
|
52 |
with <s>text-bison@001</s> gemini-pro foundation model. Model performance evaluation via <a href='https://wandb.ai/bstraehle'>Weights & Biases</a>."""
|