alpaca-cpp / app.py
awinml's picture
Update app.py
2596b06
raw
history blame
492 Bytes
import gradio as gr
from llama_cpp import Llama
llm = Llama(model_path="ggml-alpaca-7b-q4.bin")
def generate_text(input_text):
output = llm(f"Q: {input_text} A:", max_tokens=256, stop=["Q:", "\n", "#"], echo=False)
return output['choices'][0]['text']
input_text = gr.inputs.Textbox(lines= 10, label="Enter your input text")
output_text = gr.outputs.Textbox(label="Output text")
gr.Interface(fn=generate_text, inputs=input_text, outputs=output_text, title="Alpaca GGML").launch()