Update app.py
Browse files
app.py
CHANGED
@@ -1,27 +1,8 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
#import streamlit as st
|
4 |
-
#from gradio_client import Client
|
5 |
-
#client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
6 |
-
#result = client.predict(
|
7 |
-
# "What is Semantic and Episodic memory?", # str in 'Search' Textbox component
|
8 |
-
# 4, # float (numeric value between 4 and 10) in 'Top n results as context' Slider component
|
9 |
-
# "Semantic Search - up to 10 Mar 2024", # Literal['Semantic Search - up to 10 Mar 2024', 'Arxiv Search - Latest - (EXPERIMENTAL)'] in 'Search Source' Dropdown component
|
10 |
-
# "mistralai/Mixtral-8x7B-Instruct-v0.1", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
11 |
-
# api_name="/update_with_rag_md"
|
12 |
-
#)
|
13 |
-
#st.markdown(result)
|
14 |
-
|
15 |
-
|
16 |
-
import streamlit as st
|
17 |
-
import os
|
18 |
-
from datetime import datetime
|
19 |
-
from gradio_client import Client
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
import streamlit as st
|
24 |
import streamlit.components.v1 as components
|
|
|
|
|
|
|
25 |
import os
|
26 |
import json
|
27 |
import random
|
@@ -35,8 +16,9 @@ import requests
|
|
35 |
import textract
|
36 |
import time
|
37 |
import zipfile
|
38 |
-
import huggingface_hub
|
39 |
import dotenv
|
|
|
|
|
40 |
from audio_recorder_streamlit import audio_recorder
|
41 |
from bs4 import BeautifulSoup
|
42 |
from collections import deque
|
@@ -55,17 +37,7 @@ from urllib.parse import quote # Ensure this import is included
|
|
55 |
## Show examples
|
56 |
sample_outputs = {
|
57 |
'output_placeholder': 'The LLM will provide an answer to your question here...',
|
58 |
-
'search_placeholder': ''
|
59 |
-
1. What is MoE?
|
60 |
-
2. What are Multi Agent Systems?
|
61 |
-
3. What is Self Rewarding AI?
|
62 |
-
4. What is Semantic and Episodic memory?
|
63 |
-
5. What is AutoGen?
|
64 |
-
6. What is ChatDev?
|
65 |
-
7. What is Omniverse?
|
66 |
-
8. What is Lumiere?
|
67 |
-
9. What is SORA?
|
68 |
-
'''
|
69 |
}
|
70 |
|
71 |
def save_file(content, file_type):
|
@@ -81,23 +53,6 @@ def load_file(file_name):
|
|
81 |
return content
|
82 |
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
#import streamlit as st
|
87 |
-
#from gradio_client import Client
|
88 |
-
#client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
89 |
-
#result = client.predict(
|
90 |
-
# "What is Semantic and Episodic memory?", # str in 'Search' Textbox component
|
91 |
-
# 4, # float (numeric value between 4 and 10) in 'Top n results as context' Slider component
|
92 |
-
# "Semantic Search - up to 10 Mar 2024", # Literal['Semantic Search - up to 10 Mar 2024', 'Arxiv Search - Latest - (EXPERIMENTAL)'] in 'Search Source' Dropdown component
|
93 |
-
# "mistralai/Mixtral-8x7B-Instruct-v0.1", # Literal['mistralai/Mixtral-8x7B-Instruct-v0.1', 'mistralai/Mistral-7B-Instruct-v0.2', 'google/gemma-7b-it', 'None'] in 'LLM Model' Dropdown component
|
94 |
-
# api_name="/update_with_rag_md"
|
95 |
-
#)
|
96 |
-
#st.markdown(result)
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
# HTML5 based Speech Synthesis (Text to Speech in Browser)
|
102 |
@st.cache_resource
|
103 |
def SpeechSynthesis(result):
|
@@ -129,19 +84,15 @@ def SpeechSynthesis(result):
|
|
129 |
components.html(documentHTML5, width=1280, height=300)
|
130 |
|
131 |
|
132 |
-
|
133 |
-
|
134 |
def search_arxiv(query):
|
135 |
-
# Show ArXiv Scholary Articles! ----------------*************-------------***************----------------------------------------
|
136 |
|
|
|
137 |
st.title("โถ๏ธ Semantic and Episodic Memory System")
|
138 |
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
139 |
-
|
140 |
search_query = query
|
141 |
top_n_results = st.slider("Top n results as context", min_value=4, max_value=100, value=100)
|
142 |
search_source = st.selectbox("Search Source", ["Semantic Search - up to 10 Mar 2024", "Arxiv Search - Latest - (EXPERIMENTAL)"])
|
143 |
llm_model = st.selectbox("LLM Model", ["mistralai/Mixtral-8x7B-Instruct-v0.1", "mistralai/Mistral-7B-Instruct-v0.2", "google/gemma-7b-it", "None"])
|
144 |
-
|
145 |
st.markdown('### ๐ ' + query)
|
146 |
result = client.predict(
|
147 |
search_query,
|
@@ -153,7 +104,6 @@ def search_arxiv(query):
|
|
153 |
st.markdown(result)
|
154 |
arxiv_results = st.text_area("ArXiv Results: ", value=result, height=700)
|
155 |
result = str(result) # cast as string for these - check content length and format if encoding changes..
|
156 |
-
|
157 |
result=result.replace('\\n', ' ')
|
158 |
SpeechSynthesis(result) # Search History Reader / Writer IO Memory - Audio at Same time as Reading.
|
159 |
filename=generate_filename(result, "md")
|
@@ -216,9 +166,6 @@ st.set_page_config(
|
|
216 |
}
|
217 |
)
|
218 |
|
219 |
-
#PromptPrefix = 'Create a markdown outline and table with appropriate emojis for top ten graphic novel plotlines where you are defining the method steps of play for topic of '
|
220 |
-
#PromptPrefix2 = 'Create a streamlit python app. Show full code listing. Create a UI implementing each feature creatively with python, streamlit, using variables and smart tables with word and idiom keys, creating reusable dense functions with graphic novel entity parameters, and data driven app with python libraries and streamlit components for Javascript and HTML5. Use appropriate emojis for labels to summarize and list parts, function, conditions for topic: '
|
221 |
-
|
222 |
# Prompts for App, for App Product, and App Product Code
|
223 |
PromptPrefix = 'Create a speccification with streamlit functions creating markdown outlines and tables rich with appropriate emojis for methodical step by step rules defining the concepts at play. Use story structure architect rules to plan, structure and write three dramatic situations to include in the rules and how to play by matching the theme for topic of '
|
224 |
PromptPrefix2 = 'Create a streamlit python user app with full code listing to create a UI implementing the using streamlit or gradio or huggingface to create user interface elements like emoji buttons, sliders, drop downs, and data interfaces like dataframes to show tables, session_state to track inventory, character advancement and experience, locations, file_uploader to allow the user to add images which are saved and referenced shown in gallery, camera_input to take character picture, on_change = function callbacks with continual running plots that change when you change data or click a button, randomness and word and letter rolls using emojis and st.markdown, st.expander for groupings and clusters of things, st.columns and other UI controls in streamlit as a game. Create inline data tables and list dictionaries for entities implemented as variables for the word game rule entities and stats. Design it as a fun data driven game app and show full python code listing for this ruleset and thematic story plot line: '
|
@@ -268,13 +215,6 @@ def display_glossary_entity(k):
|
|
268 |
|
269 |
|
270 |
#st.markdown('''### ๐โจ๐ Arxiv-Paper-Search-QA-RAG-Streamlit-Gradio-AP ''')
|
271 |
-
#with st.expander("Help / About ๐", expanded=False):
|
272 |
-
# st.markdown('''
|
273 |
-
# - ๐ **Unlock Words:** Elevate your vocabulary with AI. Turns words into thrilling experiences.
|
274 |
-
# - ๐ **Features:** Creates extensive glossaries & exciting challenges.
|
275 |
-
# - ๐งโโ๏ธ **Experience:** Become a word wizard, boost your language skills.
|
276 |
-
# - ๐ **Query Use:** Input `?q=Palindrome` or `?query=Anagram` in URL for new challenges.
|
277 |
-
# ''')
|
278 |
|
279 |
roleplaying_glossary = {
|
280 |
"๐ค AI Concepts": {
|
@@ -398,10 +338,6 @@ roleplaying_glossary = {
|
|
398 |
}
|
399 |
}
|
400 |
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
@st.cache_resource
|
406 |
def get_table_download_link(file_path):
|
407 |
with open(file_path, 'r') as file:
|
@@ -521,8 +457,6 @@ def FileSidebar():
|
|
521 |
except:
|
522 |
st.markdown('GPT is sleeping. Restart ETA 30 seconds.')
|
523 |
# ----------------------------------------------------- File Sidebar for Jump Gates ------------------------------------------
|
524 |
-
|
525 |
-
|
526 |
FileSidebar()
|
527 |
|
528 |
|
@@ -549,16 +483,9 @@ selected_image_url = random.choice(image_urls)
|
|
549 |
selected_image_base64 = get_image_as_base64(selected_image_url)
|
550 |
if selected_image_base64 is not None:
|
551 |
with st.sidebar:
|
552 |
-
#st.markdown("""### Word Game AI""")
|
553 |
st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
|
554 |
else:
|
555 |
st.sidebar.write("Failed to load the image.")
|
556 |
-
|
557 |
-
# ---- Art Card Sidebar with random selection of image.
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
|
563 |
# Ensure the directory for storing scores exists
|
564 |
score_dir = "scores"
|
@@ -576,13 +503,10 @@ def update_score(key, increment=1):
|
|
576 |
score_data = json.load(file)
|
577 |
else:
|
578 |
score_data = {"clicks": 0, "score": 0}
|
579 |
-
|
580 |
score_data["clicks"] += 1
|
581 |
score_data["score"] += increment
|
582 |
-
|
583 |
with open(score_file, "w") as file:
|
584 |
json.dump(score_data, file)
|
585 |
-
|
586 |
return score_data["score"]
|
587 |
|
588 |
# Function to load score
|
@@ -600,9 +524,9 @@ def search_glossary(query): # ๐Run------------------------------------------
|
|
600 |
if query.lower() in (term.lower() for term in terms):
|
601 |
st.markdown(f"#### {category}")
|
602 |
st.write(f"- {query}")
|
603 |
-
|
604 |
all=""
|
605 |
|
|
|
606 |
WordGameRules="""Generate 10 high-information words related to word game rules, used in context with emojis:
|
607 |
1. ๐ Rules: The official guidelines that govern the gameplay and objectives of a word game.
|
608 |
2. โฐ Time Limit: A constraint on the duration allowed for players to complete their turns or the entire game.
|
@@ -614,7 +538,6 @@ def search_glossary(query): # ๐Run------------------------------------------
|
|
614 |
8. ๐ Challenge: An action that allows players to contest the validity of words formed by their opponents.
|
615 |
9. ๐ฐ Score: Points earned by players for forming valid words, often based on letter values and word length.
|
616 |
10. โ Pass: An option for players to skip their turn if unable to form a word, sometimes with penalties."""
|
617 |
-
|
618 |
WordGamePython="""Generate 10 high-information words related to word game programming in Python, used in context with emojis:
|
619 |
1. ๐ Python: A high-level programming language known for its simplicity and readability.
|
620 |
2. ๐ String: A data type used to represent text, essential for handling words in a word game.
|
@@ -627,7 +550,7 @@ def search_glossary(query): # ๐Run------------------------------------------
|
|
627 |
9. ๐พ File I/O: Reading from and writing to files, useful for storing game data like high scores or word lists.
|
628 |
10. ๐ค AI: Implementing artificial intelligence techniques to create computer-controlled opponents in word games."""
|
629 |
|
630 |
-
|
631 |
WordGamePython2="""1. ๐จ Streamlit: A Python library for building interactive web apps, perfect for creating word games.
|
632 |
Example: st.title("Welcome to the Word Guessing Game! ๐ฎ")
|
633 |
|
@@ -703,7 +626,6 @@ Example: letter_queue = deque(random.sample(string.ascii_uppercase, 10))"""
|
|
703 |
all = query + ' ' + response
|
704 |
st.write('๐Run Paper Summarizer is Complete.')
|
705 |
# experimental 45 - - - - - - - - - - - - -<><><><><>
|
706 |
-
|
707 |
|
708 |
|
709 |
# ๐Run 2 - Specification Expert - Write a Document to Specify Inner Dialog of Expert
|
@@ -741,16 +663,11 @@ Example: letter_queue = deque(random.sample(string.ascii_uppercase, 10))"""
|
|
741 |
all = all + webquery + ' ' + webresponse
|
742 |
st.write('๐Run 4 is Complete.')
|
743 |
|
744 |
-
|
745 |
-
#PromptPrefix2 = 'Create a streamlit python user app with full code listing to create a UI implementing the plans, structure, situations and tables as python functions creating a word game with parts of speech and humorous word play which operates like word game rules and creates a compelling fun story using streamlit to create user interface elements like emoji buttons, sliders, drop downs, and data interfaces like dataframes to show tables, session_state to track inventory, character advancement and experience, locations, file_uploader to allow the user to add images which are saved and referenced shown in gallery, camera_input to take character picture, on_change = function callbacks with continual running plots that change when you change data or click a button, randomness and word and letter rolls using emojis and st.markdown, st.expander for groupings and clusters of things, st.columns and other UI controls in streamlit as a game. Create inline data tables and list dictionaries for entities implemented as variables for the word game rule entities and stats. Design it as a fun data driven game app and show full python code listing for this ruleset and thematic story plot line: '
|
746 |
-
#PromptPrefix3 = 'Create a HTML5 aframe and javascript app using appropriate libraries to create a word game simulation with advanced libraries like aframe to render 3d scenes creating moving entities that stay within a bounding box but show text and animation in 3d for inventory, components and story entities. Show full code listing. Add a list of new random entities say 3 of a few different types to any list appropriately and use emojis to make things easier and fun to read. Use appropriate emojis in labels. Create the UI to implement storytelling in the style of a dungeon master, with features using three emoji appropriate text plot twists and recurring interesting funny fascinating and complex almost poetic named characters with genius traits and file IO, randomness, ten point choice lists, math distribution tradeoffs, witty humorous dilemnas with emoji , rewards, variables, reusable functions with parameters, and data driven app with python libraries and streamlit components for Javascript and HTML5. Use appropriate emojis for labels to summarize and list parts, function, conditions for topic:'
|
747 |
-
|
748 |
response = response + specresponse + coderesponse + webresponse
|
749 |
filename = generate_filename(response, "md")
|
750 |
create_file(filename, query, response, should_save)
|
751 |
queries = query + specquery + codequery + webquery
|
752 |
|
753 |
-
#SpeechSynthesis(response)
|
754 |
return all # ๐Run--------------------------------------------------------
|
755 |
|
756 |
|
@@ -852,7 +769,6 @@ def display_content_or_image(query):
|
|
852 |
return True
|
853 |
st.warning("No matching content or image found.")
|
854 |
return False
|
855 |
-
|
856 |
|
857 |
game_emojis = {
|
858 |
"Dungeons and Dragons": "๐",
|
@@ -927,21 +843,16 @@ def display_images_and_wikipedia_summaries():
|
|
927 |
if not image_files:
|
928 |
st.write("No PNG images found in the current directory.")
|
929 |
return
|
930 |
-
|
931 |
for image_file in image_files:
|
932 |
image = Image.open(image_file)
|
933 |
st.image(image, caption=image_file, use_column_width=True)
|
934 |
-
|
935 |
keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
|
936 |
-
|
937 |
# Display Wikipedia and Google search links
|
938 |
wikipedia_url = create_search_url_wikipedia(keyword)
|
939 |
google_url = create_search_url_google(keyword)
|
940 |
youtube_url = create_search_url_youtube(keyword)
|
941 |
bing_url = create_search_url_bing(keyword)
|
942 |
ai_url = create_search_url_ai(keyword)
|
943 |
-
|
944 |
-
|
945 |
links_md = f"""
|
946 |
[Wikipedia]({wikipedia_url}) |
|
947 |
[Google]({google_url}) |
|
@@ -951,15 +862,12 @@ def display_images_and_wikipedia_summaries():
|
|
951 |
"""
|
952 |
st.markdown(links_md)
|
953 |
|
954 |
-
|
955 |
def get_all_query_params(key):
|
956 |
return st.query_params().get(key, [])
|
957 |
|
958 |
def clear_query_params():
|
959 |
st.query_params()
|
960 |
|
961 |
-
|
962 |
-
|
963 |
# My Inference API Copy
|
964 |
API_URL = 'https://qe55p8afio98s0u3.us-east-1.aws.endpoints.huggingface.cloud' # Dr Llama
|
965 |
# Meta's Original - Chat HF Free Version:
|
@@ -1585,12 +1493,4 @@ if st.button("Clear Query Parameters", key='ClearQueryParams'):
|
|
1585 |
|
1586 |
# 18. Run AI Pipeline
|
1587 |
if __name__ == "__main__":
|
1588 |
-
whisper_main()
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import streamlit.components.v1 as components
|
3 |
+
import huggingface_hub
|
4 |
+
import gradio_client as gc
|
5 |
+
|
6 |
import os
|
7 |
import json
|
8 |
import random
|
|
|
16 |
import textract
|
17 |
import time
|
18 |
import zipfile
|
|
|
19 |
import dotenv
|
20 |
+
|
21 |
+
from gradio_client import Client
|
22 |
from audio_recorder_streamlit import audio_recorder
|
23 |
from bs4 import BeautifulSoup
|
24 |
from collections import deque
|
|
|
37 |
## Show examples
|
38 |
sample_outputs = {
|
39 |
'output_placeholder': 'The LLM will provide an answer to your question here...',
|
40 |
+
'search_placeholder': '1. What is MoE, Multi Agent Systems, Self Rewarding AI, Semantic and Episodic memory, What is AutoGen, ChatDev, Omniverse, Lumiere, SORA?'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
def save_file(content, file_type):
|
|
|
53 |
return content
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
# HTML5 based Speech Synthesis (Text to Speech in Browser)
|
57 |
@st.cache_resource
|
58 |
def SpeechSynthesis(result):
|
|
|
84 |
components.html(documentHTML5, width=1280, height=300)
|
85 |
|
86 |
|
|
|
|
|
87 |
def search_arxiv(query):
|
|
|
88 |
|
89 |
+
# Show ArXiv Scholary Articles! ----------------*************-------------***************----------------------------------------
|
90 |
st.title("โถ๏ธ Semantic and Episodic Memory System")
|
91 |
client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
|
|
|
92 |
search_query = query
|
93 |
top_n_results = st.slider("Top n results as context", min_value=4, max_value=100, value=100)
|
94 |
search_source = st.selectbox("Search Source", ["Semantic Search - up to 10 Mar 2024", "Arxiv Search - Latest - (EXPERIMENTAL)"])
|
95 |
llm_model = st.selectbox("LLM Model", ["mistralai/Mixtral-8x7B-Instruct-v0.1", "mistralai/Mistral-7B-Instruct-v0.2", "google/gemma-7b-it", "None"])
|
|
|
96 |
st.markdown('### ๐ ' + query)
|
97 |
result = client.predict(
|
98 |
search_query,
|
|
|
104 |
st.markdown(result)
|
105 |
arxiv_results = st.text_area("ArXiv Results: ", value=result, height=700)
|
106 |
result = str(result) # cast as string for these - check content length and format if encoding changes..
|
|
|
107 |
result=result.replace('\\n', ' ')
|
108 |
SpeechSynthesis(result) # Search History Reader / Writer IO Memory - Audio at Same time as Reading.
|
109 |
filename=generate_filename(result, "md")
|
|
|
166 |
}
|
167 |
)
|
168 |
|
|
|
|
|
|
|
169 |
# Prompts for App, for App Product, and App Product Code
|
170 |
PromptPrefix = 'Create a speccification with streamlit functions creating markdown outlines and tables rich with appropriate emojis for methodical step by step rules defining the concepts at play. Use story structure architect rules to plan, structure and write three dramatic situations to include in the rules and how to play by matching the theme for topic of '
|
171 |
PromptPrefix2 = 'Create a streamlit python user app with full code listing to create a UI implementing the using streamlit or gradio or huggingface to create user interface elements like emoji buttons, sliders, drop downs, and data interfaces like dataframes to show tables, session_state to track inventory, character advancement and experience, locations, file_uploader to allow the user to add images which are saved and referenced shown in gallery, camera_input to take character picture, on_change = function callbacks with continual running plots that change when you change data or click a button, randomness and word and letter rolls using emojis and st.markdown, st.expander for groupings and clusters of things, st.columns and other UI controls in streamlit as a game. Create inline data tables and list dictionaries for entities implemented as variables for the word game rule entities and stats. Design it as a fun data driven game app and show full python code listing for this ruleset and thematic story plot line: '
|
|
|
215 |
|
216 |
|
217 |
#st.markdown('''### ๐โจ๐ Arxiv-Paper-Search-QA-RAG-Streamlit-Gradio-AP ''')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
|
219 |
roleplaying_glossary = {
|
220 |
"๐ค AI Concepts": {
|
|
|
338 |
}
|
339 |
}
|
340 |
|
|
|
|
|
|
|
|
|
341 |
@st.cache_resource
|
342 |
def get_table_download_link(file_path):
|
343 |
with open(file_path, 'r') as file:
|
|
|
457 |
except:
|
458 |
st.markdown('GPT is sleeping. Restart ETA 30 seconds.')
|
459 |
# ----------------------------------------------------- File Sidebar for Jump Gates ------------------------------------------
|
|
|
|
|
460 |
FileSidebar()
|
461 |
|
462 |
|
|
|
483 |
selected_image_base64 = get_image_as_base64(selected_image_url)
|
484 |
if selected_image_base64 is not None:
|
485 |
with st.sidebar:
|
|
|
486 |
st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
|
487 |
else:
|
488 |
st.sidebar.write("Failed to load the image.")
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
|
490 |
# Ensure the directory for storing scores exists
|
491 |
score_dir = "scores"
|
|
|
503 |
score_data = json.load(file)
|
504 |
else:
|
505 |
score_data = {"clicks": 0, "score": 0}
|
|
|
506 |
score_data["clicks"] += 1
|
507 |
score_data["score"] += increment
|
|
|
508 |
with open(score_file, "w") as file:
|
509 |
json.dump(score_data, file)
|
|
|
510 |
return score_data["score"]
|
511 |
|
512 |
# Function to load score
|
|
|
524 |
if query.lower() in (term.lower() for term in terms):
|
525 |
st.markdown(f"#### {category}")
|
526 |
st.write(f"- {query}")
|
|
|
527 |
all=""
|
528 |
|
529 |
+
|
530 |
WordGameRules="""Generate 10 high-information words related to word game rules, used in context with emojis:
|
531 |
1. ๐ Rules: The official guidelines that govern the gameplay and objectives of a word game.
|
532 |
2. โฐ Time Limit: A constraint on the duration allowed for players to complete their turns or the entire game.
|
|
|
538 |
8. ๐ Challenge: An action that allows players to contest the validity of words formed by their opponents.
|
539 |
9. ๐ฐ Score: Points earned by players for forming valid words, often based on letter values and word length.
|
540 |
10. โ Pass: An option for players to skip their turn if unable to form a word, sometimes with penalties."""
|
|
|
541 |
WordGamePython="""Generate 10 high-information words related to word game programming in Python, used in context with emojis:
|
542 |
1. ๐ Python: A high-level programming language known for its simplicity and readability.
|
543 |
2. ๐ String: A data type used to represent text, essential for handling words in a word game.
|
|
|
550 |
9. ๐พ File I/O: Reading from and writing to files, useful for storing game data like high scores or word lists.
|
551 |
10. ๐ค AI: Implementing artificial intelligence techniques to create computer-controlled opponents in word games."""
|
552 |
|
553 |
+
|
554 |
WordGamePython2="""1. ๐จ Streamlit: A Python library for building interactive web apps, perfect for creating word games.
|
555 |
Example: st.title("Welcome to the Word Guessing Game! ๐ฎ")
|
556 |
|
|
|
626 |
all = query + ' ' + response
|
627 |
st.write('๐Run Paper Summarizer is Complete.')
|
628 |
# experimental 45 - - - - - - - - - - - - -<><><><><>
|
|
|
629 |
|
630 |
|
631 |
# ๐Run 2 - Specification Expert - Write a Document to Specify Inner Dialog of Expert
|
|
|
663 |
all = all + webquery + ' ' + webresponse
|
664 |
st.write('๐Run 4 is Complete.')
|
665 |
|
|
|
|
|
|
|
|
|
666 |
response = response + specresponse + coderesponse + webresponse
|
667 |
filename = generate_filename(response, "md")
|
668 |
create_file(filename, query, response, should_save)
|
669 |
queries = query + specquery + codequery + webquery
|
670 |
|
|
|
671 |
return all # ๐Run--------------------------------------------------------
|
672 |
|
673 |
|
|
|
769 |
return True
|
770 |
st.warning("No matching content or image found.")
|
771 |
return False
|
|
|
772 |
|
773 |
game_emojis = {
|
774 |
"Dungeons and Dragons": "๐",
|
|
|
843 |
if not image_files:
|
844 |
st.write("No PNG images found in the current directory.")
|
845 |
return
|
|
|
846 |
for image_file in image_files:
|
847 |
image = Image.open(image_file)
|
848 |
st.image(image, caption=image_file, use_column_width=True)
|
|
|
849 |
keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
|
|
|
850 |
# Display Wikipedia and Google search links
|
851 |
wikipedia_url = create_search_url_wikipedia(keyword)
|
852 |
google_url = create_search_url_google(keyword)
|
853 |
youtube_url = create_search_url_youtube(keyword)
|
854 |
bing_url = create_search_url_bing(keyword)
|
855 |
ai_url = create_search_url_ai(keyword)
|
|
|
|
|
856 |
links_md = f"""
|
857 |
[Wikipedia]({wikipedia_url}) |
|
858 |
[Google]({google_url}) |
|
|
|
862 |
"""
|
863 |
st.markdown(links_md)
|
864 |
|
|
|
865 |
def get_all_query_params(key):
|
866 |
return st.query_params().get(key, [])
|
867 |
|
868 |
def clear_query_params():
|
869 |
st.query_params()
|
870 |
|
|
|
|
|
871 |
# My Inference API Copy
|
872 |
API_URL = 'https://qe55p8afio98s0u3.us-east-1.aws.endpoints.huggingface.cloud' # Dr Llama
|
873 |
# Meta's Original - Chat HF Free Version:
|
|
|
1493 |
|
1494 |
# 18. Run AI Pipeline
|
1495 |
if __name__ == "__main__":
|
1496 |
+
whisper_main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|