File size: 485 Bytes
5d58d95 ab9be79 5d58d95 ab9be79 aed9fa3 c6ad043 5d58d95 c6ad043 ab9be79 5d58d95 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# -*- coding: utf-8 -*-
import streamlit as st
import subprocess
def run_llama(input):
output = subprocess.check_output(['./main', '-m', 'ggml-vicuna-7b-1.1-q4_0.bin', '-p', "User: "+ input + ". Assistant:"])
output_str = str(output.decode('utf-8'))
response = output_str.split("Asistente:")[-1].strip()
return response
st.title("Llama Model")
input_text = st.text_input("Input Text", "")
if st.button("Run"):
output = run_llama(input_text)
st.write(output) |