Skip to content

Commit

Permalink
fixed bottom of the chatbox going under input textfield
Browse files Browse the repository at this point in the history
  • Loading branch information
CORRUPTOR2037 committed Jun 27, 2023
1 parent 5a36fca commit 562df76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 12 additions & 3 deletions webui/app.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from model import ExLlama, ExLlamaConfig
from flask import Flask, render_template, request, jsonify
from flask import Response, stream_with_context
from threading import Timer, Lock
import webbrowser
import json
import model_init
from session import prepare_sessions, get_initial_session, Session, load_session, new_session, _sessions_dir
from session import prepare_sessions, get_generator, get_initial_session, Session, load_session, new_session, _sessions_dir
import argparse
from tokenizer import ExLlamaTokenizer
from model import ExLlama, ExLlamaConfig
from waitress import serve

app = Flask(__name__)
Expand Down Expand Up @@ -139,12 +139,21 @@ def api_append_block():
data = request.get_json()
session.api_append_block(data)
return json.dumps({"result": "ok"}) + "\n"

@app.route('/inference', methods=['POST'])
def inferContextP():
prompt = request.form.get('prompt')
tokens = int(request.form.get('max_tokens', 200))

outputs = get_generator().generate_simple(prompt, max_new_tokens = tokens)
print(outputs)
return outputs

# Load the model

parser = argparse.ArgumentParser(description="Simple web-based chatbot for ExLlama")
parser.add_argument("-host", "--host", type = str, help = "IP:PORT eg, 0.0.0.0:7862", default = "localhost:5000")
parser.add_argument("-sd", "--sessions_dir", type = str, help = "Location for storing user sessions, default: ~/exllama_sessions/", default = "~/exllama_sessions/")
parser.add_argument("-sd", "--sessions-dir", type = str, help = "Location for storing user sessions, default: ~/exllama_sessions/", default = "~/exllama_sessions/")

model_init.add_args(parser)
args = parser.parse_args()
Expand Down
2 changes: 2 additions & 0 deletions webui/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ svg:hover {
padding-top: 10px;
padding-bottom: 10px;
box-sizing: border-box;
top: 0px;
position: fixed;
}

#chat-column {
Expand Down

0 comments on commit 562df76

Please sign in to comment.