File size: 618 Bytes
c172768
68741d5
 
 
 
f8a5464
 
 
 
68741d5
 
 
 
c172768
68741d5
0591543
68741d5
c172768
f8a5464
c172768
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
import banana_dev as banana
import os
api_key = os.getenv("API_KEY")
model_key = os.getenv("MODEL_KEY")

title = "CodeAlpaca"
description = "Instruction following model for code generation."
examples = ["Write a python function to sort a list."]
def call_model(prompt):
    model_parameters = {
        "prompt": prompt,
        "max_length":1000

    }
    out = banana.run(api_key, model_key, model_parameters)    
    return out["modelOutputs"][0]["output"]

iface = gr.Interface(fn=call_model, inputs="text", outputs="text",examples=examples,description=description,title=title)
iface.launch()