chore: update something
Browse files
app.py
CHANGED
@@ -23,7 +23,6 @@ import SelfExtend
|
|
23 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
24 |
from bs4 import BeautifulSoup
|
25 |
from functools import lru_cache
|
26 |
-
from datetime import datetime, timezone
|
27 |
|
28 |
|
29 |
MAX_MAX_NEW_TOKENS = 8192
|
@@ -414,7 +413,7 @@ def generate(
|
|
414 |
|
415 |
def build_input_ids(
|
416 |
apply_tools: bool = None,
|
417 |
-
references
|
418 |
):
|
419 |
conversation = []
|
420 |
if system_prompt:
|
@@ -423,7 +422,7 @@ def generate(
|
|
423 |
conversation.append({"role": "tools", "content": supported_tools})
|
424 |
|
425 |
if references is None:
|
426 |
-
references = [local_date_time]
|
427 |
else:
|
428 |
references.insert(0, local_date_time)
|
429 |
|
@@ -569,8 +568,6 @@ chatbot = gr.Chatbot(
|
|
569 |
height=500, placeholder=PLACEHOLDER, label="Ghost 8B Beta", show_copy_button=True
|
570 |
)
|
571 |
|
572 |
-
utc_dt = datetime.now(timezone.utc)
|
573 |
-
|
574 |
chat_interface = gr.ChatInterface(
|
575 |
fn=generate,
|
576 |
chatbot=chatbot,
|
@@ -616,12 +613,10 @@ chat_interface = gr.ChatInterface(
|
|
616 |
value=1.0,
|
617 |
),
|
618 |
gr.Textbox(
|
619 |
-
label="
|
620 |
lines=1,
|
621 |
-
value="This user's current time: {}".format(
|
622 |
-
|
623 |
-
),
|
624 |
-
visible=True,
|
625 |
),
|
626 |
],
|
627 |
stop_btn="Stop",
|
|
|
23 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
24 |
from bs4 import BeautifulSoup
|
25 |
from functools import lru_cache
|
|
|
26 |
|
27 |
|
28 |
MAX_MAX_NEW_TOKENS = 8192
|
|
|
413 |
|
414 |
def build_input_ids(
|
415 |
apply_tools: bool = None,
|
416 |
+
references=None,
|
417 |
):
|
418 |
conversation = []
|
419 |
if system_prompt:
|
|
|
422 |
conversation.append({"role": "tools", "content": supported_tools})
|
423 |
|
424 |
if references is None:
|
425 |
+
references = [local_date_time]
|
426 |
else:
|
427 |
references.insert(0, local_date_time)
|
428 |
|
|
|
568 |
height=500, placeholder=PLACEHOLDER, label="Ghost 8B Beta", show_copy_button=True
|
569 |
)
|
570 |
|
|
|
|
|
571 |
chat_interface = gr.ChatInterface(
|
572 |
fn=generate,
|
573 |
chatbot=chatbot,
|
|
|
613 |
value=1.0,
|
614 |
),
|
615 |
gr.Textbox(
|
616 |
+
label="Other client information",
|
617 |
lines=1,
|
618 |
+
value="This user's current time: {}".format(time.strftime("%Y-%m-%d")),
|
619 |
+
visible=False,
|
|
|
|
|
620 |
),
|
621 |
],
|
622 |
stop_btn="Stop",
|