Spaces:
Runtime error
Runtime error
add examples
Browse files
app.py
CHANGED
@@ -3,6 +3,10 @@ import banana_dev as banana
|
|
3 |
import os
|
4 |
api_key = os.getenv("API_KEY")
|
5 |
model_key = os.getenv("MODEL_KEY")
|
|
|
|
|
|
|
|
|
6 |
def call_model(prompt):
|
7 |
model_parameters = {
|
8 |
"prompt": prompt,
|
@@ -15,5 +19,5 @@ def call_model(prompt):
|
|
15 |
|
16 |
return out["modelOutputs"][0]["output"]
|
17 |
|
18 |
-
iface = gr.Interface(fn=call_model, inputs="text", outputs="text")
|
19 |
iface.launch()
|
|
|
3 |
import os
|
4 |
api_key = os.getenv("API_KEY")
|
5 |
model_key = os.getenv("MODEL_KEY")
|
6 |
+
|
7 |
+
title = "CodeAlpaca"
|
8 |
+
description = "Instruction following model for code generation."
|
9 |
+
examples = ["Write a python function to sort a list."]
|
10 |
def call_model(prompt):
|
11 |
model_parameters = {
|
12 |
"prompt": prompt,
|
|
|
19 |
|
20 |
return out["modelOutputs"][0]["output"]
|
21 |
|
22 |
+
iface = gr.Interface(fn=call_model, inputs="text", outputs="text",examples=examples,description=description,title=title)
|
23 |
iface.launch()
|