Yahir commited on
Commit
5d58d95
·
1 Parent(s): 02644ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,11 +1,15 @@
 
1
  import streamlit as st
2
  import subprocess
 
3
  def run_llama(input):
4
- output = subprocess.check_output(['./main', '-m', 'qunt4_0.bin', '-p Usuario:', input, '. Assistant:'])
5
- return str(output.decode('utf-8'))
 
 
6
  st.title("Llama Model")
7
 
8
  input_text = st.text_input("Input Text", "")
9
  if st.button("Run"):
10
  output = run_llama(input_text)
11
- st.write(output)
 
1
+ # -*- coding: utf-8 -*-
2
  import streamlit as st
3
  import subprocess
4
+
5
  def run_llama(input):
6
+ output = subprocess.check_output(['./main', '-m', 'qunt4_0.bin', '-p',"UTranscript of a dialog, where the User interacts with an Assistant named Bob. Bob is helpful, kind, honest, good at writing, and never fails to answer the User's requests immediately and with precision. Usuario: "+ input + ". Asistente:"]) output_str = str(output.decode('utf-8'))
7
+ response = output_str.split("Asistente:")[-1].strip()
8
+ return response
9
+
10
  st.title("Llama Model")
11
 
12
  input_text = st.text_input("Input Text", "")
13
  if st.button("Run"):
14
  output = run_llama(input_text)
15
+ st.write(output)