Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -447,7 +447,6 @@ def display_glossary_grid(roleplaying_glossary):
|
|
447 |
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
|
448 |
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
|
449 |
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
|
450 |
-
|
451 |
}
|
452 |
|
453 |
for category, details in roleplaying_glossary.items():
|
@@ -460,7 +459,19 @@ def display_glossary_grid(roleplaying_glossary):
|
|
460 |
links_md = ' '.join([f"[{emoji}]({url(term)})" for emoji, url in search_urls.items()])
|
461 |
st.markdown(f"{term} {links_md}", unsafe_allow_html=True)
|
462 |
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
|
465 |
|
466 |
game_emojis = {
|
@@ -558,25 +569,27 @@ def display_videos_and_links():
|
|
558 |
st.video(video_file, format='video/mp4', start_time=0)
|
559 |
|
560 |
# Display Wikipedia and Google search links
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
[
|
573 |
-
[
|
574 |
-
[
|
575 |
-
[
|
576 |
-
[AI
|
577 |
-
|
578 |
-
|
579 |
-
|
|
|
|
|
580 |
|
581 |
|
582 |
def display_images_and_wikipedia_summaries():
|
@@ -607,25 +620,28 @@ def display_images_and_wikipedia_summaries():
|
|
607 |
st.image(image, caption=image_file, use_column_width=True)
|
608 |
|
609 |
# Display Wikipedia and Google search links
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
[
|
623 |
-
[
|
624 |
-
[
|
625 |
-
[
|
626 |
-
|
627 |
-
|
628 |
-
|
|
|
|
|
|
|
629 |
|
630 |
|
631 |
def get_all_query_params(key):
|
|
|
447 |
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
|
448 |
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
|
449 |
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
|
|
|
450 |
}
|
451 |
|
452 |
for category, details in roleplaying_glossary.items():
|
|
|
459 |
links_md = ' '.join([f"[{emoji}]({url(term)})" for emoji, url in search_urls.items()])
|
460 |
st.markdown(f"{term} {links_md}", unsafe_allow_html=True)
|
461 |
|
462 |
+
def display_glossary_entity(k):
|
463 |
+
search_urls = {
|
464 |
+
"π": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
|
465 |
+
"π": lambda k: f"https://www.google.com/search?q={quote(k)}",
|
466 |
+
"βΆοΈ": lambda k: f"https://www.youtube.com/results?search_query={quote(k)}",
|
467 |
+
"π": lambda k: f"https://www.bing.com/search?q={quote(k)}",
|
468 |
+
"π²": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(k)}", # this url plus query!
|
469 |
+
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
|
470 |
+
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
|
471 |
+
"π": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
|
472 |
+
}
|
473 |
+
links_md = ' '.join([f"[{emoji}]({url(k)})" for emoji, url in search_urls.items()])
|
474 |
+
st.markdown(f"{k} {links_md}", unsafe_allow_html=True)
|
475 |
|
476 |
|
477 |
game_emojis = {
|
|
|
569 |
st.video(video_file, format='video/mp4', start_time=0)
|
570 |
|
571 |
# Display Wikipedia and Google search links
|
572 |
+
k = video_file.split('.')[0] # Assumes keyword is the file name without extension
|
573 |
+
display_glossary_entity(k)
|
574 |
+
|
575 |
+
#wikipedia_url = create_search_url_wikipedia(keyword)
|
576 |
+
#google_url = create_search_url_google(keyword)
|
577 |
+
#youtube_url = create_search_url_youtube(keyword)
|
578 |
+
#bing_url = create_search_url_bing(keyword)
|
579 |
+
#ai_url = create_search_url_ai(keyword)
|
580 |
+
#ai_url2 = create_search_url_ai(keyword + ' ' + PromptPrefix)
|
581 |
+
#ai_url3 = create_search_url_ai(keyword + ' ' + PromptPrefix2)
|
582 |
+
#links_md = f"""
|
583 |
+
#[Wikipedia]({wikipedia_url}) |
|
584 |
+
#[Google]({google_url}) |
|
585 |
+
#[YouTube]({youtube_url}) |
|
586 |
+
#[Bing]({bing_url}) |
|
587 |
+
#[AI]({ai_url})|
|
588 |
+
#[AI Novel]({ai_url2} )|
|
589 |
+
#[AI Novel App]({ai_url3})
|
590 |
+
#"""
|
591 |
+
#st.markdown(links_md)
|
592 |
+
#col_index += 1
|
593 |
|
594 |
|
595 |
def display_images_and_wikipedia_summaries():
|
|
|
620 |
st.image(image, caption=image_file, use_column_width=True)
|
621 |
|
622 |
# Display Wikipedia and Google search links
|
623 |
+
k = image_file.split('.')[0] # Assumes keyword is the file name without extension
|
624 |
+
|
625 |
+
display_glossary_entity(k)
|
626 |
+
|
627 |
+
#wikipedia_url = create_search_url_wikipedia(keyword)
|
628 |
+
#google_url = create_search_url_google(keyword)
|
629 |
+
#youtube_url = create_search_url_youtube(keyword)
|
630 |
+
#bing_url = create_search_url_bing(keyword)
|
631 |
+
#ai_url = create_search_url_ai(keyword)
|
632 |
+
#ai_url2 = create_search_url_ai(keyword + ' ' + PromptPrefix)
|
633 |
+
#ai_url3 = create_search_url_ai(keyword + ' ' + PromptPrefix2)
|
634 |
+
#links_md = f"""
|
635 |
+
#[Wikipedia]({wikipedia_url}) |
|
636 |
+
#[Google]({google_url}) |
|
637 |
+
#[YouTube]({youtube_url}) |
|
638 |
+
#[Bing]({bing_url}) |
|
639 |
+
#[AI]({ai_url})|
|
640 |
+
#[AI Novel]({ai_url2} )|
|
641 |
+
#[AI Novel App]({ai_url3})
|
642 |
+
#"""
|
643 |
+
#st.markdown(links_md)
|
644 |
+
#col_index += 1
|
645 |
|
646 |
|
647 |
def get_all_query_params(key):
|