Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from resume import data
|
|
3 |
import markdowm as md
|
4 |
import gradio as gr
|
5 |
import base64
|
|
|
6 |
|
7 |
client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
|
8 |
|
@@ -30,7 +31,9 @@ def respond(
|
|
30 |
messages.append({"role": "user", "content": val[0]})
|
31 |
if val[1]:
|
32 |
messages.append({"role": "assistant", "content": val[1]})
|
33 |
-
|
|
|
|
|
34 |
# Adding the current user input
|
35 |
messages.append({"role": "user", "content": message})
|
36 |
|
@@ -48,8 +51,6 @@ def respond(
|
|
48 |
response += token
|
49 |
yield response
|
50 |
|
51 |
-
print(f"{message}->{response}")
|
52 |
-
|
53 |
|
54 |
def encode_image(image_path):
|
55 |
with open(image_path, "rb") as image_file:
|
@@ -64,10 +65,10 @@ website_logo_encoded = encode_image("Images/ai-logo.png")
|
|
64 |
with gr.Blocks(theme=gr.themes.Ocean(font=[gr.themes.GoogleFont("Roboto Mono")]), css='footer {visibility: hidden}') as main:
|
65 |
gr.Markdown(md.title)
|
66 |
with gr.Tabs():
|
67 |
-
with gr.TabItem("Resume"):
|
68 |
gr.Markdown(data)
|
69 |
|
70 |
-
with gr.TabItem("My2.0"):
|
71 |
gr.ChatInterface(respond,
|
72 |
chatbot=gr.Chatbot(height=500),
|
73 |
examples=["Tell me about yourself",
|
|
|
3 |
import markdowm as md
|
4 |
import gradio as gr
|
5 |
import base64
|
6 |
+
import datetime
|
7 |
|
8 |
client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
|
9 |
|
|
|
31 |
messages.append({"role": "user", "content": val[0]})
|
32 |
if val[1]:
|
33 |
messages.append({"role": "assistant", "content": val[1]})
|
34 |
+
|
35 |
+
print(f"{datetime.datetime.now()}::{message}->{response}")
|
36 |
+
|
37 |
# Adding the current user input
|
38 |
messages.append({"role": "user", "content": message})
|
39 |
|
|
|
51 |
response += token
|
52 |
yield response
|
53 |
|
|
|
|
|
54 |
|
55 |
def encode_image(image_path):
|
56 |
with open(image_path, "rb") as image_file:
|
|
|
65 |
with gr.Blocks(theme=gr.themes.Ocean(font=[gr.themes.GoogleFont("Roboto Mono")]), css='footer {visibility: hidden}') as main:
|
66 |
gr.Markdown(md.title)
|
67 |
with gr.Tabs():
|
68 |
+
with gr.TabItem("Resume", visible=True, interactive=True):
|
69 |
gr.Markdown(data)
|
70 |
|
71 |
+
with gr.TabItem("My2.0", visible=True, interactive=True):
|
72 |
gr.ChatInterface(respond,
|
73 |
chatbot=gr.Chatbot(height=500),
|
74 |
examples=["Tell me about yourself",
|