Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from huggingface_hub import InferenceClient
|
| 2 |
import gradio as gr
|
| 3 |
|
|
@@ -15,7 +20,7 @@ def format_prompt(message, history):
|
|
| 15 |
return prompt
|
| 16 |
|
| 17 |
|
| 18 |
-
|
| 19 |
def format_prompt(message, history):
|
| 20 |
prompt = "<s>"
|
| 21 |
for user_prompt, bot_response in history:
|
|
@@ -23,7 +28,7 @@ def format_prompt(message, history):
|
|
| 23 |
prompt += f" {bot_response}</s> "
|
| 24 |
prompt += f"[INST] As a psychology counselor assistant, provide an assessment and plan for the following counseling notes. Please present a summary, don't make it so long. Present in lines.: {message} [/INST]"
|
| 25 |
return prompt
|
| 26 |
-
|
| 27 |
|
| 28 |
def generate(
|
| 29 |
prompt, history, temperature=0.9, max_new_tokens=1024, top_p=0.95, repetition_penalty=1.0,
|
|
@@ -65,4 +70,5 @@ gr.ChatInterface(
|
|
| 65 |
description="Enter counseling notes to generate an assessment and plan.",
|
| 66 |
examples=examples,
|
| 67 |
concurrency_limit=20,
|
| 68 |
-
).launch(show_api=
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
gr.load("models/TurtleLiu/mistral7b_psychology_bot").launch()
|
| 4 |
+
|
| 5 |
+
'''
|
| 6 |
from huggingface_hub import InferenceClient
|
| 7 |
import gradio as gr
|
| 8 |
|
|
|
|
| 20 |
return prompt
|
| 21 |
|
| 22 |
|
| 23 |
+
|
| 24 |
def format_prompt(message, history):
|
| 25 |
prompt = "<s>"
|
| 26 |
for user_prompt, bot_response in history:
|
|
|
|
| 28 |
prompt += f" {bot_response}</s> "
|
| 29 |
prompt += f"[INST] As a psychology counselor assistant, provide an assessment and plan for the following counseling notes. Please present a summary, don't make it so long. Present in lines.: {message} [/INST]"
|
| 30 |
return prompt
|
| 31 |
+
|
| 32 |
|
| 33 |
def generate(
|
| 34 |
prompt, history, temperature=0.9, max_new_tokens=1024, top_p=0.95, repetition_penalty=1.0,
|
|
|
|
| 70 |
description="Enter counseling notes to generate an assessment and plan.",
|
| 71 |
examples=examples,
|
| 72 |
concurrency_limit=20,
|
| 73 |
+
).launch(show_api=False, debug=True)
|
| 74 |
+
'''
|