Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,10 @@ from utils import *
|
|
8 |
from presets import *
|
9 |
|
10 |
#antwort=""
|
|
|
|
|
11 |
|
|
|
12 |
# Create a chatbot connection
|
13 |
#chatbot = hugchat.ChatBot(cookie_path="cookies.json")
|
14 |
|
@@ -18,7 +21,8 @@ base_model = "EleutherAI/gpt-neo-1.3B"
|
|
18 |
tokenizer,model,device = load_tokenizer_and_model(base_model)
|
19 |
|
20 |
|
21 |
-
|
|
|
22 |
def predict(text,
|
23 |
chatbotGr,
|
24 |
history,
|
@@ -80,9 +84,19 @@ def reset_chat():
|
|
80 |
#id_new = chatbot.new_conversation()
|
81 |
#chatbot.change_conversation(id_new)
|
82 |
reset_textbox()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
|
85 |
-
|
|
|
86 |
with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
87 |
history = gr.State([])
|
88 |
user_question = gr.State("")
|
@@ -150,10 +164,10 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
|
150 |
|
151 |
with gr.TabItem("Übersetzungen"):
|
152 |
with gr.Row():
|
153 |
-
gr.Interface(, inputs="Hier entsteht ein Übersetzer mit KI...", outputs="text")
|
154 |
with gr.TabItem("Code-genereierungen"):
|
155 |
with gr.Row():
|
156 |
-
gr.Interface(, inputs="Hier entsteht eine Ki fürs Programmieren...", outputs="text")
|
157 |
|
158 |
predict_args = dict(
|
159 |
fn=predict,
|
|
|
8 |
from presets import *
|
9 |
|
10 |
#antwort=""
|
11 |
+
######################################################################
|
12 |
+
#Modelle und Tokenizer
|
13 |
|
14 |
+
#Hugging Chat nutzen
|
15 |
# Create a chatbot connection
|
16 |
#chatbot = hugchat.ChatBot(cookie_path="cookies.json")
|
17 |
|
|
|
21 |
tokenizer,model,device = load_tokenizer_and_model(base_model)
|
22 |
|
23 |
|
24 |
+
########################################################################
|
25 |
+
#Chat KI nutzen, um Text zu generieren...
|
26 |
def predict(text,
|
27 |
chatbotGr,
|
28 |
history,
|
|
|
84 |
#id_new = chatbot.new_conversation()
|
85 |
#chatbot.change_conversation(id_new)
|
86 |
reset_textbox()
|
87 |
+
|
88 |
+
##########################################################
|
89 |
+
#Übersetzungs Ki nutzen
|
90 |
+
def translate():
|
91 |
+
return "Kommt noch!"
|
92 |
+
|
93 |
+
#Programmcode KI
|
94 |
+
def codeing():
|
95 |
+
return "Kommt noch!"
|
96 |
|
97 |
+
#######################################################################
|
98 |
+
#Darstellung mit Gradio
|
99 |
+
|
100 |
with gr.Blocks(theme=small_and_beautiful_theme) as demo:
|
101 |
history = gr.State([])
|
102 |
user_question = gr.State("")
|
|
|
164 |
|
165 |
with gr.TabItem("Übersetzungen"):
|
166 |
with gr.Row():
|
167 |
+
gr.Interface(translate, inputs="Hier entsteht ein Übersetzer mit KI...", outputs="text")
|
168 |
with gr.TabItem("Code-genereierungen"):
|
169 |
with gr.Row():
|
170 |
+
gr.Interface(coding, inputs="Hier entsteht eine Ki fürs Programmieren...", outputs="text")
|
171 |
|
172 |
predict_args = dict(
|
173 |
fn=predict,
|