Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ from langchain.vectorstores import FAISS
|
|
| 14 |
from langchain.llms import OpenAI
|
| 15 |
from langchain.chains.question_answering import load_qa_chain
|
| 16 |
from langchain.callbacks import get_openai_callback
|
|
|
|
| 17 |
|
| 18 |
nltk.download('punkt')
|
| 19 |
|
|
@@ -166,31 +167,8 @@ def main():
|
|
| 166 |
<br>
|
| 167 |
<div class="question-box" id="question3">Was sind die Vorteile des ambulanten operierens?</div>
|
| 168 |
""", unsafe_allow_html=True)
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
js_script = """
|
| 172 |
-
<script>
|
| 173 |
-
document.getElementById('question1').onclick = function() {
|
| 174 |
-
console.log('Question 1 box clicked');
|
| 175 |
-
document.querySelectorAll('div.stTextInput input')[0].value = 'Was genau ist ein Belegarzt?';
|
| 176 |
-
document.querySelectorAll('div.stTextInput input')[0].dispatchEvent(new Event('change'));
|
| 177 |
-
document.querySelector('button[data-baseweb="button"]').click();
|
| 178 |
-
};
|
| 179 |
-
document.getElementById('question2').onclick = function() {
|
| 180 |
-
console.log('Question 2 box clicked');
|
| 181 |
-
document.querySelectorAll('div.stTextInput input')[0].value = 'Wofür wird die Alpha-ID verwendet?';
|
| 182 |
-
document.querySelectorAll('div.stTextInput input')[0].dispatchEvent(new Event('change'));
|
| 183 |
-
document.querySelector('button[data-baseweb="button"]').click();
|
| 184 |
-
};
|
| 185 |
-
document.getElementById('question3').onclick = function() {
|
| 186 |
-
console.log('Question 3 box clicked');
|
| 187 |
-
document.querySelectorAll('div.stTextInput input')[0].value = 'Was sind die Vorteile des ambulanten operierens?';
|
| 188 |
-
document.querySelectorAll('div.stTextInput input')[0].dispatchEvent(new Event('change'));
|
| 189 |
-
document.querySelector('button[data-baseweb="button"]').click();
|
| 190 |
-
};
|
| 191 |
-
</script>
|
| 192 |
-
"""
|
| 193 |
-
components.html(js_script, height=0)
|
| 194 |
|
| 195 |
if __name__ == "__main__":
|
| 196 |
main()
|
|
|
|
| 14 |
from langchain.llms import OpenAI
|
| 15 |
from langchain.chains.question_answering import load_qa_chain
|
| 16 |
from langchain.callbacks import get_openai_callback
|
| 17 |
+
from my_component import my_component
|
| 18 |
|
| 19 |
nltk.download('punkt')
|
| 20 |
|
|
|
|
| 167 |
<br>
|
| 168 |
<div class="question-box" id="question3">Was sind die Vorteile des ambulanten operierens?</div>
|
| 169 |
""", unsafe_allow_html=True)
|
| 170 |
+
|
| 171 |
+
my_component()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
if __name__ == "__main__":
|
| 174 |
main()
|