kwabs22 commited on
Commit
6287464
1 Parent(s): 04177de
Files changed (2) hide show
  1. README.md +2 -0
  2. app.py +157 -62
README.md CHANGED
@@ -6,6 +6,8 @@ colorTo: yellow
6
  sdk: docker
7
  pinned: true
8
  fullWidth: true
 
 
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
6
  sdk: docker
7
  pinned: true
8
  fullWidth: true
9
+ models:
10
+ facebook/nllb-200-distilled-600M
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -33,6 +33,8 @@ from spacy_syllables import SpacySyllables #https://spacy.io/universe/project/sp
33
  import torch
34
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
35
  from flores200_codes import flores_codes #- figure this out after it works
 
 
36
 
37
  #When I forgot about the readme file ChatGPT suggested these - Leaving to remember the Readme.md must be updated as well
38
  #print(gr.__version__)
@@ -67,13 +69,12 @@ nltk.download('averaged_perceptron_tagger') #Parts of Speech Tagging
67
  nltk.download('udhr') # Declaration of Human rights in many languages
68
 
69
 
70
- #spacy.cli.download("en_core_web_sm") #download in the docker file
71
  #spacy.cli.download('ko_core_news_sm')
72
  #spacy.cli.download('ja_core_news_sm')
73
  #spacy.cli.download('zh_core_web_sm')
74
  #spacy.cli.download("es_core_news_sm")
75
  #spacy.cli.download("de_core_news_sm")
76
- #print(spacy.info()) #Docker install path debugging
77
 
78
  nlp_en = spacy.load("en_core_web_sm")
79
  nlp_de = spacy.load("de_core_news_sm")
@@ -246,8 +247,8 @@ def merge_lines(roman_file, w4w_file, full_mean_file, macaronic_file):
246
 
247
  return "\n".join(merged_lines)
248
 
249
- TTSLangOptions = gr.Dropdown(choices=langdropdown_choices, value="en", label="choose the language of the srt/text accent") #["en", "de", "es", "ja", "ko", "zh-cn"]
250
- TTSLangOptions2 = gr.Dropdown(choices=langdropdown_choices, value="en", label="choose the language of the srt/text accent")
251
 
252
  def TTSforListeningPractice(text, language = "en", Repeat10x = False):
253
  if Repeat10x:
@@ -1778,7 +1779,7 @@ def lingualinkassist(text, language):
1778
  def w4wsidebysidereadergen(text, langdest):
1779
  #FrontRevSentChunk as reference
1780
  FinalOutput = "Side by Side Version: "
1781
- Translated = "FWNWO: "
1782
  words = text.split()
1783
  w4wsidebysidtranslator = Translator()
1784
  translatedFWO = w4wsidebysidtranslator.translate(text, dest=langdest[:2])
@@ -1794,7 +1795,10 @@ def w4wsidebysidereadergen(text, langdest):
1794
  # print(f"Pronunciation: {obj.pronunciation}\n")
1795
  FinalOutput += obj.origin + f" ({obj.text}) "
1796
  Translated += obj.text + " "
1797
- return FinalOutput, Translated, "FWFWO: " + translatedFWO.text
 
 
 
1798
 
1799
  #https://huggingface.co/spaces/Geonmo/nllb-translation-demo/blob/main/app.py
1800
  def nllbtranscload_models():
@@ -1844,7 +1848,18 @@ def nllbtransctranslation(source, target, text):
1844
  'result': output}
1845
  return result['result'], result['inference_time']
1846
 
1847
- #pip install tokenizers==0.13.3 protobuf==3.20.0
 
 
 
 
 
 
 
 
 
 
 
1848
 
1849
  #----------------------------------------------------------------------------------------------------------------------------
1850
 
@@ -1936,14 +1951,45 @@ def letterbased_guess_word(target, guess):
1936
  speedmastery_load_imagesinput = gr.Files(file_count="multiple", type="binary") #, file_types='image')
1937
 
1938
  def speedmastery_load_images(image_files):
1939
- #return [image_file for image_file in image_files]
 
 
 
 
 
 
 
 
1940
  images = []
1941
  for image_file in image_files:
1942
- # Read the image file and convert it to a PIL.Image object
1943
- image = Image.open(io.BytesIO(image_file))
 
 
 
 
 
 
1944
  images.append(image)
 
 
 
 
1945
  return images
1946
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1947
 
1948
  # Define the Gradio interface inputs and outputs for video split
1949
  spvvideo_file_input = gr.File(label='Video File')
@@ -1964,7 +2010,7 @@ randomExposuremessage2 = randommarquee()
1964
  VideoTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
1965
  VideoTestSubtitleInput = gr.File(label="select a subtitle file", file_types=[".txt", ".srt", ".vtt"])
1966
  VideoSplitTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
1967
- SplitVideoOutput = gr.FileExplorer(root='./splitvideo')
1968
 
1969
  with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', secondary_hue='red', neutral_hue='blue', )
1970
  gr.HTML('<div style="display: flex; justify-content: center; align-items: center; height: 100%;"> Reading comprehension speed through picture based compression (collage), Live Image Subtitles and Listening Comprehension Test - <a href="https://chat.openai.com/g/g-bYMSVlb8y-lingua-link"> -- Lingua Link (Simple GPT for assistinng image creation) -- </a> | </div><div style="display: flex; justify-content: center; align-items: center; height: 100%;"> ---- Under Construction: Very Slowly figuring out what AI intergrated interface means (Chat vs Forms vs Function calling vs Sensor + Trigger vs Agent) | How to end copy paste once and for all? ---- </div> <div style="display: flex; justify-content: center; align-items: center; height: 100%;"> All the apis from the below space need to be treated like RAG as notes for the LLM to read before providing its answer </div>')
@@ -1976,7 +2022,7 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
1976
  translatespacebtn.click(display_website, inputs=linktotranslate, outputs=translatespace)
1977
  with gr.Accordion("LLM HF Spaces/Sites (Click Here to Open) - Use 'Acronym Map Creation Space' Tab with this - Ask for Translation of image tags made below, sentence to emojis, Wordlists, Test Conversations, Get Grammar Explanations etc., Can use GPT-4 or new SOTA to review the conversation", open=False):
1978
  with gr.Row():
1979
- linktochat = gr.Dropdown(choices=["https://sdk.vercel.ai/docs", "https://labs.perplexity.ai/", "https://chat.lmsys.org", "https://deepseek-ai-deepseek-coder-7b-instruct.hf.space", "https://01-ai-yi-34b-chat.hf.space", "https://ysharma-zephyr-playground.hf.space", "https://huggingfaceh4-zephyr-chat.hf.space", "https://osanseviero-mistral-super-fast.hf.space", "https://artificialguybr-qwen-14b-chat-demo.hf.space", "https://huggingface-projects-llama-2-7b-chat.hf.space", "https://ysharma-explore-llamav2-with-tgi.hf.space", "https://mosaicml-mpt-30b-chat.hf.space", "https://huggingfaceh4-falcon-chat.hf.space", "https://uwnlp-guanaco-playground-tgi.hf.space", "https://stabilityai-stablelm-tuned-alpha-chat.hf.space", "https://mosaicml-mpt-7b-storywriter.hf.space", "https://huggingfaceh4-starchat-playground.hf.space", "https://bigcode-bigcode-playground.hf.space", "https://mosaicml-mpt-7b-chat.hf.space", "https://huggingchat-chat-ui.hf.space", "https://togethercomputer-openchatkit.hf.space"], label="Choose/Cancel type any .hf.space link here (can also type a link)'", allow_custom_value=True)
1980
  chatspacebtn = gr.Button("Use the chosen URL to load interface with a chat model. For sdk.vercel click the chat button on the top left. For lymsys / chat arena copy the link and use a new tab")
1981
  with gr.Accordion("Some prompt ideas", open=False):
1982
  with gr.Accordion("Prompts in text (Manual copy paste)", open=False):
@@ -1999,7 +2045,7 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
1999
  #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2000
  with gr.Row():
2001
  with gr.Column(scale=1):
2002
- gr.HTML(""" <div style="height: 350px; width: 100%; border: 1px solid black; overflow: auto;"> Some useful links <br> <a href='https://github.com/eugeneyan/open-llms'> -- Opensource List -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard'> -- Open LLM Leaderboard -- </a> | <a href='https://openxlab.org.cn/apps'> -- Openxlabs - Huggingface Alternative -- </a> | <a href='https://huggingface.co/spaces/sanchit-gandhi/whisper-jax'> -- Whisper JAX -- </a> | <a href="https://translate.google.com/?hl=en&tab=TT"> -- Google Translate -- </a> | <a href='https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis'> -- Modelscope Text to Video -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion'> -- stable-diffusion 2 -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion-1'> -- stable-diffusion 1 -- </a> | <a href='https://huggingface.co/spaces/kakaobrain/karlo'> -- karlo 1 -- </a> | <a href='https://huggingface.co/spaces/suno/bark'> -- Bark (TTS) -- </a> | <a href='https://chat.lmsys.org/'> -- Offline Text Model Demos -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a> | <a href='https://beta.elevenlabs.io/'> -- Eleven Labs -- </a> | <a href='https://www.d-id.com/'> -- Animate an Image -- </a> | <a href='https://voice.ai/'> -- Clone a voice -- </a> | <a href='https://openai.com/pricing'> -- OpenAI pricing -- </a> | <a href='https://huggingface.co/spaces/sohojoe/soho-clip-embeddings-explorer'> -- Image Training Data Search -- </a> | <a href='https://huggingface.co/spaces/huggingchat/chat-ui'> -- Huggingface Chat -- </a> | <a href='https://huggingface.co/spaces/bguisard/stable-diffusion-nano'> -- 128x128 Stable Diffusion (Fast) -- </a> | <a href='https://huggingface.co/spaces/colonelwatch/abstracts-index'> -- Search 95 million research abstracts -- </a> | <a href='https://huggingface.co/datasets/roneneldan/TinyStories'> -- Tiny Stories Dataset -- </a> | <a href='https://huggingface.co/spaces/lykeven/visualglm-6b'> -- Visualglm6b - Discuss images -- </a> | <a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/camenduru/potat1'> -- Potat1 Text2vid -- </a> | <a href='https://twitter.com/willdepue/status/1661781355452325889'> -- Alexandria Prohect (Will Deque) - Free Embeddings -- </a> | <a href='https://artsandculture.google.com/'> -- Google Arts and Culture Portal -- </a> | <a href='https://huggingface.co/spaces/Matthijs/whisper_word_timestamps'> -- Word Level Timestamps -- </a> | <a href='https://huggingface.co/spaces/zaanind/NLLB-translation'> -- NLLB 600M Demo -- </a> = <a href='https://github.com/facebookresearch/fairseq/tree/nllb'> -- NLLB Github -- </a> | <a href='https://huggingface.co/spaces/hysts/zeroscope-v2'> -- Zeroscope v2 Text to video -- </a> | <a href='https://huggingface.co/spaces/SpacesExamples/ComfyUI'> -- ComfyUI Text to Image -- </a> | <a href='https://huggingface.co/spaces/DeepFloyd/IF'> -- Deepfloyd IF - Text in image -- </a> | <a href='https://huggingface.co/spaces/ysharma/ChatGPT-Plugins-in-Gradio'> -- ChatGPT Custom Plugins Test Space -- </a> | <a href='https://www.reddit.com/r/LocalLLaMA/'> -- r/LocalLlama -- </a> | <a href='https://www.reddit.com/r/singularity/'> -- r/Singularity -- </a> | <a href='https://huggingface.co/spaces/hysts/SD-XL'> -- SD-XL Test Space -- </a> | <a href='https://huggingface.co/spaces/facebook/seamless_m4t'> -- Seamless M4T - Translation one stop shop -- </a> | <a href='https://huggingface.co/spaces/codellama/codellama-playground'> -- Code Llama playground -- </a> | <a href='https://huggingface.co/spaces/Voicemod/Text-to-Sing'> -- Text to sing -- </a> | <a href='https://huggingface.co/spaces/camenduru-com/webui'> -- Stable Diffusion Webui (Camenduru Space) -- </a> | <a href='https://huggingface.co/spaces/ysharma/WizardCoder34b'> -- Wizard Coder 34B -- </a> | <a href='https://huggingface.co/spaces/chansung/co-write-with-llama2'> -- Cowrite with llama2 -- </a> | <a href='https://huggingface.co/spaces/fffiloni/Image-to-Story'> -- Image to Story -- </a> | <a href='https://huggingface.co/spaces/fffiloni/CLIP-Interrogator-2'> -- Clip interrogator 2 -- </a> | <a href='https://github.com/THUDM/AgentBench'> -- Agent Benchmarks -- </a> | <a href='https://www.convex.dev/ai-town'> -- AI Town Live Demo -- </a> = <a href='https://github.com/a16z-infra/ai-town'> -- AI Town Repository (Deployment]) -- </a> | <a href='https://github.com/joonspk-research/generative_agents/tree/main'> -- Generative Agents: Interactive Simulacra of Human Behavior (Research paper Repository) -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceM4/idefics_playground'> -- IDEFICS - open Multimodal model -- </a> | <a href='https://github.com/facebookresearch/belebele'> -- Belebele (Meta Dataset) -- </a> | <a href='https://huggingface.co/spaces/jbilcke-hf/ai-comic-factory'> -- AI Comic Factory -- </a> | <a href='https://github.com/camenduru'> -- CAMENDURU REPOS -- </a> | <a href='https://huggingface.co/datasets/b-mc2/sql-create-context'> -- SQL Dataset - A list of simple questions -- </a> | <a href='https://github.com/KillianLucas/open-interpreter'> -- Open Interpreter (alt to ChatGPT Pro) -- </a> | <a href='https://easywithai.com/fun-ai-tools/'> -- List - Easy with AI -- </a> | <a href='https://huggingface.co/spaces/Xenova/whisper-web'> -- Whisper Web (UI) -- </a> | <a href='https://blog.roblox.com/2023/09/revolutionizing-creation-roblox/'> -- Roblox Assistant -- </a> | <a href='https://huggingface.co/spaces/AP123/IllusionDiffusion'> -- Illusion Diffusion (Hide words or shapes in the image) -- </a> | <a href='https://huggingface.co/spaces/Shopify/background-replacement'> -- Background replacement - Shopify -- </a> | <a href='https://huggingface.co/spaces/multimodalart/LoraTheExplorer'> -- Lora The Explorer (SDXL) -- </a> | <a href='https://huggingface.co/spaces/XCLiu/InstaFlow'> -- InstaFlow (Under 1 second Inference) -- </a> | <a href='https://github.com/tairov/llama2.mojo'> -- TinyStories on mojo (230+ tk/s) -- </a> | <a href='https://emojis.alexandru.so/p/OHVEmfMwQl'> -- Any Emoji you want - emojijs -- </a> | <a href='https://huggingface.co/spaces/google/sdxl'> -- SDXL on TPUv5 -- </a> | <a href='https://huggingface.co/spaces/SimianLuo/Latent_Consistency_Model'> -- LCM - SD1.5 at 7secs per 4 images (after coldstart) -- </a> | <a href='https://huggingface.co/spaces/fffiloni/sdxl-control-loras'> -- SDXL Control Lora -- </a> | <a href='https://huggingface.co/spaces/aadnk/faster-whisper-webui'> -- Whisper WebUI -- </a> | <a href='https://huggingface.co/spaces/guoyww/AnimateDiff'> -- AnimateDiff: Create an image make a video -- </a> | <a href='https://huggingface.co/spaces/facebook/seamless-m4t-v2-large'> -- Seamless m4t v2 -- </a> | <a href='https://huggingface.co/spaces/Otter-AI/OtterHD-Demo'> -- OtterHD: Multimodal model -- </a> | <a href='https://ai.meta.com/blog/ego-exo4d-video-learning-perception/'> -- Ego-exo4d Multimodal dataset -- </a> | <a href='https://imagine.meta.com/'> -- Meta Imagine images (Free) -- </a> | <a href='https://www.mage.space/'> -- Mage Space images (Free) -- </a> | <a href='https://www.bing.com/images/create?FORM=GENILP'> -- Bing Image Creator (Free) -- </a> | <a href='https://jalammar.github.io/'> -- Jay Alammar Blog - Illustrated Transformer, Stable Diffusion and More -- </a> | </div>""")
2003
  with gr.Tabs() as nav1:
2004
  with gr.Tab("Rep - HTML"):
2005
  gr.HTML("UNWFWO = Unknown Native Word Foreign Word Order i.e. during active listening practice you only need the words you dont know")
@@ -2037,43 +2083,61 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
2037
  #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2038
  with gr.Column(scale=3):
2039
  with gr.Tab("General Idea"):
2040
- gr.HTML("True mastery is from the relations between each item aka how every word relates to each other - Repitition in the form combinatorics ")
2041
- with gr.Accordion("Memorisation by string comparison idea", open=False):
2042
- gr.HTML('Result of prompt chain starting with: Lets say I have the strings "red" and "ppalgan" how can I guess the second from the first from just spelling (eg. similar words and distance in the alphabet, ...), how can I use python to do this i.e. output of no matching letters, closest letter to r, then e, then d, a dictionary of letters that look similar eg. d and p, l and I a and d etc.')
 
 
 
 
 
2043
  gr.Interface(fn=letterbased_guess_word, inputs=["text", "text"], outputs="text", description="letter based guess suggestions (one word to one word is the designed use case)")
2044
  gr.HTML("Side by side reading creator (Google Translate) TODO - Roman output of Non roman characters")
2045
  with gr.Group():
2046
  with gr.Row():
2047
  #gr.Interface(fn=w4wsidebysidereadergen, inputs=["text", w4wsidebysidelangdest], outputs=["text", "text", "text"], description="Side by side reading creator")
2048
- w4wsidebysideinput = gr.Text(label="Paste Text you want to learn here (wordlists and UDHR can be used as )", placeholder="Enter Text Here")
2049
  with gr.Row():
2050
  w4wsidebysidelangdest = gr.Dropdown(choices=langdropdown_choices, label="Choose destination language", value="de: german")
 
2051
  w4wsidebysidebtn = gr.Button("Create Side by Side, FWNWO, and FWFWO (Just read start to finish of each till you can read the FWFWO without assistance)")
2052
  with gr.Row():
2053
  w4wsidebysideOutput = gr.Text(label="Side by side", placeholder="Side by side will display here")
2054
  w4wsidebysideFWNWOOutput = gr.Text(label="Foreign Word Native Word Order", placeholder="FW NWO will display here")
2055
  w4wsidebysideFWFWOOutput = gr.Text(label="Foreign Word Foreign Word Order", placeholder="FW FWO will display here")
2056
- w4wsidebysidebtn.click(fn=w4wsidebysidereadergen, inputs=[w4wsidebysideinput, w4wsidebysidelangdest], outputs=[w4wsidebysideOutput, w4wsidebysideFWNWOOutput, w4wsidebysideFWFWOOutput])
2057
  with gr.Row():
2058
- gr.HTML("Coming Soon")
 
 
 
 
 
 
 
 
2059
  with gr.Row():
2060
  w4wsidebysideWordCountOutput = gr.Text(label="Word Count", placeholder="Word Count will display here")
2061
  w4wsidebysideRandomisedOutput = gr.Text(label="Random Order As Test", placeholder="Randomised version (Transition Tab most left bottom) will display here")
2062
  w4wsidebysideQueGenOutput = gr.Text(label="Questions generation as comprehension test", placeholder="Questions generated will display here")
2063
  w4wsidebysideUNWFWOOutput = gr.Text(label="HTML as UNWFWO assistant", placeholder="HTML as UNWFWO assistant download will display here")
2064
- gr.HTML("Side by side reading creator (NLLB-600M (+-3gb / setting has 400 tokens? as max length for inference optimisation?)- 200 languages vs 107 in googletrans) - <a href='https://github.com/facebookresearch/fairseq/tree/nllb'> -- Fairseq Github -- </a> | inspired by - <a href='https://huggingface.co/spaces/Geonmo/nllb-translation-demo'> -- Geonmo NLLB Demo (Runtime Error Dec 23) -- </a> | <a href='https://huggingface.co/spaces/vutuka/nllb-vutuka-translation'> -- Vutuka demo (Working) -- </a>")
2065
  with gr.Group():
2066
  gr.HTML("Under Construction - generator and cpu based to beat gpu cost, cpu wait time and network dependency for local use")
2067
  nllbtranscpuinput = gr.Text(label="Paste Text you want to learn here (wordlists and UDHR can be used as )", placeholder="Enter Text Here")
2068
  with gr.Row():
 
2069
  nllbtranscpulangsrc = gr.Dropdown(choices=nllb_lang_codes, label="Choose source language", value="English")
2070
  nllbtranscpulangdest = gr.Dropdown(choices=nllb_lang_codes, label="Choose target language", value="Akan")
2071
- nllbtranscpubtn = gr.Button("Create Side by Side, FWNWO, and FWFWO (Just read start to finish of each till you can read the FWFWO without assistance)")
 
2072
  with gr.Row():
2073
- with gr.Column(scale=4):
2074
- nllbtranscpuOutput = gr.Text(label="Side by side", placeholder="Side by side will display here")
2075
- with gr.Column(scale=1):
 
2076
  nllbtranscpudetailsOutput = gr.Text(label="Inference Details", placeholder="Details will display here")
 
 
2077
  nllbtranscpubtn.click(fn=nllbtransctranslation, inputs=[nllbtranscpulangsrc, nllbtranscpulangdest, nllbtranscpuinput], outputs=[nllbtranscpuOutput, nllbtranscpudetailsOutput])
2078
  gr.Interface(fn=LoadNLTKUDHRText, inputs=NLTKudhr, outputs=["text", "textarea"], description="UDHR as some test texts")
2079
  with gr.Tab("Youtube Subs Listening Comprehension"):
@@ -2083,7 +2147,7 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
2083
  gr.HTML(" <a href='https://huggingface.co/spaces/artificialguybr/VIDEO-TRANSLATION-TRANSCRIPTION'> -- artificialguybr's Video Translation/Transcription Space -- </a> | ")
2084
  with gr.Group():
2085
  gr.HTML("Custom Subtitles Ideas - Realtime Practice = Test (Pause to learn)")
2086
- YTTransciptOutDropdown = gr.Dropdown(choices=["https://www.youtube.com/watch?v=UYk43fncV68&pp=ygULcnVubmluZyBtYW4%3D", "https://youtu.be/dxVaP0-aFIE"], value="https://www.youtube.com/watch?v=UYk43fncV68&pp=ygULcnVubmluZyBtYW4%3D", allow_custom_value=True)
2087
  YTTransciptOutbtn = gr.Button("Transcript to text")
2088
  YTTransciptOutVid = gr.HTML('Video will load Here')
2089
  gr.Interface(fn=subtitle_generator, inputs=None, outputs=["textbox", "textbox", "textbox"], description='Modified Subtitles Test - will only work after video has been loaded')
@@ -2138,21 +2202,49 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
2138
  gr.HTML("For Audio Most productive is real time recall of native (where your full reasoning ability will always be) <br><hr> Find Replace new lines of the foreign text with full stops or | to get per word translation")
2139
  gr.Interface(fn=TTSforListeningPractice, inputs=["text", TTSLangOptions2], outputs="audio", description="Paste only english words in foreign order and then keep removing the words from this to practice as effectively")
2140
  with gr.Tab("Speed through Imagery"):
2141
- gr.HTML("Categories for Image Creation <br>1. Extract only nouns <br>2. Extract Acronyms <br>3. Convert verbs to Careers <br>Dall-E 3 best for multi concept images - every thing else = one picture at a time <br>Ask the llm to create a prompt from the nouns extracted or to create english words ot sentences from the acronyms")
2142
- ImageryInput = gr.Textbox(placeholder='Enter the text here and use in this tab')
2143
- gr.HTML("<a href='https://chat.openai.com/g/g-bYMSVlb8y-lingua-link'> -- Lingua Link (Simple GPT for assistinng image creation) -- </a> <br>Use with placeholder generator tab below ")
2144
- gr.Interface(fn=lingualinkassist, inputs=["text","text"], outputs="text", description="Lingua Link Prompt Assistance")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2145
  with gr.Tab("Filter Text"):
 
2146
  gr.Interface(fn=onlyplurals, inputs=["text"], outputs=["text"], description="Only plurals = optimal concepts to learn first as LT work = repitition")
2147
  gr.Interface(fn=create_acronym_map, inputs="textbox", outputs="textbox", description="Acronyms")
2148
  gr.Interface(fn=keep_nouns, inputs="textbox", outputs="textbox", description="Nouns only")
2149
  with gr.Tab("Placeholder Genration"):
2150
- gr.HTML("Placeholder for every images of each sentence - Good ChatGPT + Dall-E ")
2151
  with gr.Row():
2152
  with gr.Column(scale=4):
2153
- imageplaceholderinput = gr.TextArea()
2154
  with gr.Column(scale=1):
2155
- gr.Label("Enter Text and Get a line by line placeholder for image associated with the text")
2156
  imageplaceholderdownload = gr.File()
2157
  imageplaceholderbtn = gr.Button("Create the image placeholder")
2158
  with gr.Row():
@@ -2162,12 +2254,11 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
2162
  imageplaceholdertextoutput = gr.Code("The code for the HTML created will come here")
2163
  imageplaceholderbtn.click(fn=imagebasedreading, inputs=[imageplaceholderinput], outputs=[imageplaceholderdownload, imageplaceholderoutput, imageplaceholdertextoutput])
2164
  with gr.Tab("Word level Placeholder Genration"):
2165
- gr.HTML("Placeholder for every images of each sentence - Good ChatGPT + Dall-E ")
2166
  with gr.Row():
2167
  with gr.Column(scale=4):
2168
- imageplaceholderinputwordlevel = gr.TextArea()
2169
  with gr.Column(scale=1):
2170
- gr.Label("Enter Text and Get a line by line placeholder for image associated with the text")
2171
  imageplaceholderdownloadwordlevel = gr.File()
2172
  imageplaceholderbtnwordlevel = gr.Button("Create the image placeholder")
2173
  with gr.Row():
@@ -2177,26 +2268,30 @@ with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', seconda
2177
  imageplaceholdertextoutputwordlevel = gr.Code("The code for the HTML created will come here")
2178
  imageplaceholderbtnwordlevel.click(fn=imagebasedreadingwordlevel, inputs=[imageplaceholderinputwordlevel], outputs=[imageplaceholderdownloadwordlevel, imageplaceholderoutputwordlevel, imageplaceholdertextoutputwordlevel])
2179
  with gr.Tab('Picture Subtitles / Image Slide Show'):
2180
- gr.HTML("----------------------------------INCOMPLETE------------------------------------ runs into filepath error")
2181
  gr.Interface(fn=speedmastery_load_images, inputs=speedmastery_load_imagesinput, outputs="gallery", description="Put the images you want to practice or work on")
2182
- gr.Image()
2183
  gr.HTML('placeholder for button to start generator for time based image recognition i.e. Picture Subtitles')
2184
- gr.Gallery()
2185
  with gr.Tab("UNWFWO - Stateful Reading - Progress Tracking"):
2186
- gr.HTML("The problem is to learn you need to repeat things you know that you didnt know thiss morning - The repitition space to the right is only half of solution <br>You need to read new stuff while revising the stuff you didnt know that you just learned aka the things you write as notes")
 
 
2187
  gr.HTML("The sentences used as notes repitition interface then can count as recently known sentences that you can ignore in favour of the sentences you didnt interact with")
2188
  gr.Label("Some Tests - click to hide - unknown word only list")
 
2189
  gr.Interface(fn=hidingbuttontesttranslate, inputs="text", outputs=["code", "html"])
2190
- gr.Label("Missing is database integration for the counter and non-english - ALSO TODO - Parralell interface for the html and acronym creator")
2191
- gr.Interface(fn=UnknownTrackTexttoApp, inputs="text", outputs=["file", "html", "code"], description="HTML mini App - UNNWFWO (To track verbs you dont know for listening practice). Use the text from here to create lists you use for the TTS section")
2192
- gr.Interface(create_acronym_map, inputs='text', outputs=['text', 'text'])
2193
  gr.HTML("On the Acronyms you need to underline the verbs")
2194
  gr.HTML("Aim for 1000 reps per item in your mind - the end goal for full sentences is to identify the SOV equivalent ASAP")
2195
  gr.Interface(fill_lines, inputs=["text", RepSched_Num_lines], outputs="text")
2196
  with gr.Tab("Kinesthetic / Mime Translation"):
2197
- gr.HTML("placeholder for prompt generator and tests for llama-cpp with slm")
2198
  gr.HTML("Keep nouns and verbs -- turn every noun into a verb -- turn every verb into a pose")
2199
- gr.HTML("Viseme Test with video recording screenshots judged LMM")
 
 
 
 
 
 
2200
  with gr.Tab("Beginner - Listen + Read"):
2201
  gr.Label("Closed Eye Recital per new word | 1 new word a minute while recycling the words from the previous minutes")
2202
  with gr.Row():
@@ -2328,8 +2423,10 @@ Each type of knowing involves different cognitive processes and levels of unders
2328
  gr.Interface(fn=create_collapsiblebutton, inputs=["textbox", "textbox", "textarea"], outputs="textbox", description="Button and Div HTML Generator, Generate the HTML for a button and the corresponding div element.")
2329
  with gr.Tab("Real-Time AI - Video/Audio/AR"):
2330
  gr.HTML("<div style='display: flex; justify-content: center; align-items: center; height: 100%;'> Agents = Custom Software (Personalised UI and Mods, among other things) = Custom Environments (AR) <a href='https://github.com/KillianLucas/open-interpreter'> -- Open Interpreter -- </a> | <a href='https://github.com/microsoft/autogen'> -- Microsoft Autogen -- </a> | </div>")
2331
- gr.HTML("Raspberry Pi / Pydroid and OpenCV and Tkinter = Frontend for OpenAI / OSS vision API as ChatGPT doesnt support video / real-time screenshot yet")
 
2332
  gr.HTML("HUD Experiment (Waiting for GPT4V API) - Full context of user situation + Ability to communicate in real-time to user using images (H100+ and low enough resolution and low enough steps - it/s = fps) - just like google maps but for real life")
 
2333
  gr.HTML("Some sample Open Interpreter Code - https://huggingface.co/spaces/ysharma/open-interpreter/blob/main/app.py")
2334
  gr.Interface(fn=ImageTranslationTest , inputs=[VideoTestInput, VideoTestSubtitleInput], outputs="video")
2335
  with gr.Accordion("STT Spaces (sanchit-gandhi spaces have microphone input)"):
@@ -2350,7 +2447,13 @@ Each type of knowing involves different cognitive processes and levels of unders
2350
  gr.HTML("<a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a>")
2351
  with gr.Tab("Incomplete Tests and Experiments"):
2352
  with gr.Tab("Multi Output and other ideas"):
2353
- gr.HTML("<span style:{'fontsize: 20'}>Start at Unkown Tracker if unseure<span> <br> UNNWFWO = Unknown Native Word Foreign Word Order i.e. during active listening practice you only need the words you dont know <br><br> General Ideas in this space - Speed of Learning = Avoid Things you know like the plague -- How to track what you know -- Counter is easiest and How you feel is the hardest (The more you know, the more confusion on what you dont know as you probably werent keeping track) <br><br> Visulisation of long text - Bottom of this page <br> Wordlist - 1 new word at a time per minute in the space to the left <br> Youtube Video Watching - Subtitles Tab <br> Reading - Unknown Tracker Tabs <br> Longer Text Memorising - Acronym Map Creation Tab and Transition Tab <br> Brainstorming - Reading Assistant <br> Random Exposure <br> ")
 
 
 
 
 
 
2354
  gr.Interface(fn=MultiOutputInterface, inputs=TestSplitandUpdateinput, outputs=["button", "text", "text", "text", "text", "text", "text", "text", "text", "text"])
2355
  with gr.Tab("Order based Forcing content into time (Time is the bottleneck)"):
2356
  gr.Label("Inspect the Transition Tab last item in left most column - RandomiseTextbyType - Incomplete, but this plus timer will work well achieve what this space aims to achieve - LLMs would choose the next set of words based on the last batch and its knowledge of your vocab level or even your current location (using phone as sensors) and can make image/audio prompts to make more engaging")
@@ -2366,17 +2469,6 @@ Each type of knowing involves different cognitive processes and levels of unders
2366
  gr.HTML("Tree and Branches approach to learning = familiarity with keywords/headings/summaries before reading the whole text <hr> Productivity/Work revolves around repitition which can be found looking for plurals and grouping terms eg. Headings and Hyper/Hyponyms Analysis")
2367
  gr.HTML("Sentence to PyDot graph")
2368
  gr.HTML("Currently a bug that locks all buttons in the space when you use this above example - Reload to fix")
2369
- with gr.Tab("Random Ideas"):
2370
- gr.HTML("<hr>(Part to be formatted as System prompt for model used as the help admin for the app) Objective - Learn vocab from video/music and have record of how far you got using as overengineered solution (to keep upto date with SOTA AI models and use cases) <br>Current Workflow = One Youtube video as focus for a week or until learned (i.e. instant recognition recall of vocab in random order exposure) <br>Timeline Brainstorm = Know Nothing (Just need Exposure - Random 10% suggesed as starting point) --- Know a little (Remove known) --- Know half (UNNWFWO) <hr> ")
2371
- gr.HTML("""<p>Spaces Test - Still Undercontruction --> Next Milestone is Turning this interface handsfree | Knowledge is a Language but productive knowledge is find replace as well | LingQ is good option for per word state management</p> <p> Arrows app json creator for easy knowledge graphing and spacy POS graph? --> Questions? -->
2372
- <p> ChatGPT Turns Learning into a read only what you dont know ask only what you dont know feedback loop --> All you have to do is keep track of what prompts you have asked in the past</p> """)
2373
- gr.HTML("<p>Target 0: Mnemonics as title of images --> Comprehensible input <br> Target 1: Dual audio at word Level while using repitition to train random recall --> Word level Time <br> Target 2: Video --> Split by sentence --> each word repeated (60) + each phrase (10) + each sentence (10) --> TTS file for practice --> State Management/Known word Tracker <br>-----------------------<br> The trick is minimum one minute of focus on a new word --> Listening is hard because there are new word within seconds and you need repeated focus on each to learn </p> <p>Audio = best long form attention mechanism AS it is ANTICIPATION (Awareness of something before it happens like knowing song Lyrics) FOCUSED - Attention (Focused Repitition) + Exposure (Random Repitition) </p> <p>Listening is hard due to different word order and word combinations (collocations more important than single words)</p> <hr>")
2374
- gr.HTML("Predictable to identify the parts of picture being described --> The description moves in one direction from one side of the image to the other side is easiest <hr>")
2375
- gr.HTML("Image = instant comprehension like Stable Diffusion --> Audiovisual experience is the most optimal reading experience <br> Manga with summary descriptions for the chapters = Most aligned visual to audio experience")
2376
- with gr.Tab("AI Tools, Prompts and games"):
2377
- gr.HTML("TODO = Llama-cpp-python with falcon 7b / openllama 7b intergrated into each of the interfaces in this space aka --> interfaces as tools for open source llm <br><br> <b>Test using gradio space/interfaces through the api as function calls for gpt3.5 and 4</b>")
2378
- with gr.Accordion('Command Based Tools - Instant verification of ability to describe'):
2379
- gr.HTML("Roblox - <a href='https://blog.roblox.com/2023/09/revolutionizing-creation-roblox/'> -- Roblox Assistant -- </a> | <br> ")
2380
  #with gr.Tab("Gradio Client Tests"):
2381
  # gr.HTML("How to return componets here in gradio (as each client interface needs different inputs) like in react")
2382
  with gr.Tab("Current Ideas to edit old sections"):
@@ -2385,8 +2477,13 @@ Each type of knowing involves different cognitive processes and levels of unders
2385
  gr.HTML("Parts that are not done - Visualisation (of acronyms / duo word sets / nouns and verbs) - The image placeholder creator script, Tracking (private = database, public = textfile export), calendar based scheduling aka alert based ")
2386
  gr.HTML("React Version of the app can combine all of these use cases into one component - so far tracking, placeholder and partially scheduling have been done")
2387
  gr.Label('True speed simultaneous - which is a boolean state = practice at simulataneous to get simultaneous |||| Another way to be fast is to practice simultaneously with the varios SOVs i.e. when you read a noun the verb must appear immediately and vice versa |||| Simultaneous Spelling is the other way to practice |||| The main goal of all reading is that next time you read you take less time this time: |||| Spped = ability to anticipate the next word |||| Anticipation of a sentence = POV |||| ')
2388
- with gr.Tab("Text to image for only nouns "):
2389
- gr.Label("Placeholder for the transformers code Generator that can be used by anyone with gpu to turn all nouns in their text to pictures (The lambda labs code)")
 
 
 
 
 
2390
  with gr.Tab("Simultanoues Practice Zone"):
2391
  gr.Label("Audio based space where you must look at the corresponding text for the audio thats playing as simultaneous practice")
2392
  gr.DataFrame(None, headers=["text", "audio"], label="Add text pairs to practice", interactive=True)
@@ -2399,8 +2496,6 @@ Each type of knowing involves different cognitive processes and levels of unders
2399
  gr.Label("Placeholder for old code for concordance and word counting in other test space")
2400
  with gr.Tab("Video Segmentation with OpenCV Test"):
2401
  gr.Interface(fn=segment_video_with_opencv, inputs=VideoSplitTestInput, outputs=SplitVideoOutput, description="Split video into even increments for better study tracking ")
2402
- with gr.Tab("State Management and Education"):
2403
- gr.HTML("Education = Learning things you didnt know yesterday and not forgetting more than you learn <br><br> What you didnt know forms = <br> Glossary <br> Lists <br> Formulas <br> graphs <br> Procedures <br> <br> for each you will need a seperate way to track the progress but amount of times + recency = approximate state ")
2404
  with gr.Tab('Acronym Map Creation Space'):
2405
  gr.HTML("Acronym cant be read with previous attentive reading - accurate measure of known vs unknown")
2406
  with gr.Row():
@@ -2426,4 +2521,4 @@ Each type of knowing involves different cognitive processes and levels of unders
2426
  gr.Textbox(label='Use this text to hold translations of the SQL rows in the above linked dataset (A kind of What I say vs what I want)')
2427
 
2428
 
2429
- lliface.queue().launch(share=True) #(inbrowser="true")
 
33
  import torch
34
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
35
  from flores200_codes import flores_codes #- figure this out after it works
36
+ import whisper
37
+ import tempfile
38
 
39
  #When I forgot about the readme file ChatGPT suggested these - Leaving to remember the Readme.md must be updated as well
40
  #print(gr.__version__)
 
69
  nltk.download('udhr') # Declaration of Human rights in many languages
70
 
71
 
72
+ #spacy.cli.download("en_core_web_sm")
73
  #spacy.cli.download('ko_core_news_sm')
74
  #spacy.cli.download('ja_core_news_sm')
75
  #spacy.cli.download('zh_core_web_sm')
76
  #spacy.cli.download("es_core_news_sm")
77
  #spacy.cli.download("de_core_news_sm")
 
78
 
79
  nlp_en = spacy.load("en_core_web_sm")
80
  nlp_de = spacy.load("de_core_news_sm")
 
247
 
248
  return "\n".join(merged_lines)
249
 
250
+ TTSLangOptions = gr.Dropdown(choices=langdropdown_choices, value="en: english", label="choose the language of the srt/text accent") #["en", "de", "es", "ja", "ko", "zh-cn"]
251
+ TTSLangOptions2 = gr.Dropdown(choices=langdropdown_choices, value="en: english", label="choose the language of the srt/text accent")
252
 
253
  def TTSforListeningPractice(text, language = "en", Repeat10x = False):
254
  if Repeat10x:
 
1779
  def w4wsidebysidereadergen(text, langdest):
1780
  #FrontRevSentChunk as reference
1781
  FinalOutput = "Side by Side Version: "
1782
+ Translated = "FWNWO: \n"
1783
  words = text.split()
1784
  w4wsidebysidtranslator = Translator()
1785
  translatedFWO = w4wsidebysidtranslator.translate(text, dest=langdest[:2])
 
1795
  # print(f"Pronunciation: {obj.pronunciation}\n")
1796
  FinalOutput += obj.origin + f" ({obj.text}) "
1797
  Translated += obj.text + " "
1798
+ speech = gTTS(text=text, lang=langdest[:2], slow="False")
1799
+ speech.save("CurrentSidebySideTTSFile.mp3")
1800
+ analysisPrompt = f"{ Translated } and \n\nFWFWO: \n{ translatedFWO.text } \n\nForeign Words Native Word Order and Foreign Word Order \nIf you had to make the notes on the word by word considerations to transform FWNWO to FWFWO what would that be? (A simple game idea where your response will be the rubrik to mark the players response against)"
1801
+ return FinalOutput, Translated, "FWFWO: \n" + translatedFWO.text, "CurrentSidebySideTTSFile.mp3", analysisPrompt
1802
 
1803
  #https://huggingface.co/spaces/Geonmo/nllb-translation-demo/blob/main/app.py
1804
  def nllbtranscload_models():
 
1848
  'result': output}
1849
  return result['result'], result['inference_time']
1850
 
1851
+ def nllbtransctranslationoptionalw4w(source, target, text):
1852
+ FinalOutput = ""
1853
+ FinalInference = 0
1854
+
1855
+ textlist = text.split()
1856
+ for item in textlist:
1857
+ currentitem, currentinference = nllbtransctranslation(source, target, item)
1858
+ FinalOutput += item + f" ({ str(currentitem) }) "
1859
+ FinalInference += float(currentinference)
1860
+ yield FinalOutput, str(FinalInference)
1861
+
1862
+ #pip install tokenizers==0.13.3 protobuf==3.20.0 - dependency debugging before convert to docker
1863
 
1864
  #----------------------------------------------------------------------------------------------------------------------------
1865
 
 
1951
  speedmastery_load_imagesinput = gr.Files(file_count="multiple", type="binary") #, file_types='image')
1952
 
1953
  def speedmastery_load_images(image_files):
1954
+ # print(image_files)
1955
+ # #return [image_file for image_file in image_files]
1956
+ # images = []
1957
+ # for image_file in image_files:
1958
+ # # Read the image file and convert it to a PIL.Image object
1959
+ # image = Image.open(io.BytesIO(image_file))
1960
+ # images.append(image)
1961
+ # return images
1962
+
1963
  images = []
1964
  for image_file in image_files:
1965
+ # Save the file to a temporary directory
1966
+ temp_dir = tempfile.gettempdir()
1967
+ file_path = os.path.join(temp_dir, image_file.name)
1968
+ with open(file_path, 'wb') as f:
1969
+ f.write(image_file.read())
1970
+
1971
+ # Now you can use the file path
1972
+ image = Image.open(file_path)
1973
  images.append(image)
1974
+
1975
+ # Optionally, delete the file after processing if it's no longer needed
1976
+ os.remove(file_path)
1977
+
1978
  return images
1979
 
1980
+ #----------------------------------------------------------------------------------------------------------------------------
1981
+
1982
+ def whisperlocaltts(filename):
1983
+ model = whisper.load_model("base")
1984
+ audio = whisper.load_audio(filename)
1985
+ audio = whisper.pad_or_trim(audio)
1986
+ mel = whisper.log_mel_spectrogram(audio).to(model.device)
1987
+ options = whisper.DecodingOptions(language= 'en', fp16=False)
1988
+
1989
+ result = whisper.decode(model, mel, options)
1990
+
1991
+ if result.no_speech_prob < 0.5:
1992
+ return result.text
1993
 
1994
  # Define the Gradio interface inputs and outputs for video split
1995
  spvvideo_file_input = gr.File(label='Video File')
 
2010
  VideoTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
2011
  VideoTestSubtitleInput = gr.File(label="select a subtitle file", file_types=[".txt", ".srt", ".vtt"])
2012
  VideoSplitTestInput = gr.File(label="select a mp4 video file", file_types=[".mp4"])
2013
+ SplitVideoOutput = gr.FileExplorer(root_dir='./splitvideo')
2014
 
2015
  with gr.Blocks() as lliface: #theme=gr.themes.Glass(primary_hue='green', secondary_hue='red', neutral_hue='blue', )
2016
  gr.HTML('<div style="display: flex; justify-content: center; align-items: center; height: 100%;"> Reading comprehension speed through picture based compression (collage), Live Image Subtitles and Listening Comprehension Test - <a href="https://chat.openai.com/g/g-bYMSVlb8y-lingua-link"> -- Lingua Link (Simple GPT for assistinng image creation) -- </a> | </div><div style="display: flex; justify-content: center; align-items: center; height: 100%;"> ---- Under Construction: Very Slowly figuring out what AI intergrated interface means (Chat vs Forms vs Function calling vs Sensor + Trigger vs Agent) | How to end copy paste once and for all? ---- </div> <div style="display: flex; justify-content: center; align-items: center; height: 100%;"> All the apis from the below space need to be treated like RAG as notes for the LLM to read before providing its answer </div>')
 
2022
  translatespacebtn.click(display_website, inputs=linktotranslate, outputs=translatespace)
2023
  with gr.Accordion("LLM HF Spaces/Sites (Click Here to Open) - Use 'Acronym Map Creation Space' Tab with this - Ask for Translation of image tags made below, sentence to emojis, Wordlists, Test Conversations, Get Grammar Explanations etc., Can use GPT-4 or new SOTA to review the conversation", open=False):
2024
  with gr.Row():
2025
+ linktochat = gr.Dropdown(choices=["https://sdk.vercel.ai/docs", "https://labs.perplexity.ai/", "https://chat.lmsys.org", "https://stabilityai-stablelm-2-1-6b-zephyr.hf.space", "https://deepseek-ai-deepseek-coder-7b-instruct.hf.space", "https://01-ai-yi-34b-chat.hf.space", "https://ysharma-zephyr-playground.hf.space", "https://huggingfaceh4-zephyr-chat.hf.space", "https://osanseviero-mistral-super-fast.hf.space", "https://artificialguybr-qwen-14b-chat-demo.hf.space", "https://huggingface-projects-llama-2-7b-chat.hf.space", "https://ysharma-explore-llamav2-with-tgi.hf.space", "https://mosaicml-mpt-30b-chat.hf.space", "https://huggingfaceh4-falcon-chat.hf.space", "https://uwnlp-guanaco-playground-tgi.hf.space", "https://stabilityai-stablelm-tuned-alpha-chat.hf.space", "https://mosaicml-mpt-7b-storywriter.hf.space", "https://huggingfaceh4-starchat-playground.hf.space", "https://bigcode-bigcode-playground.hf.space", "https://mosaicml-mpt-7b-chat.hf.space", "https://huggingchat-chat-ui.hf.space", "https://togethercomputer-openchatkit.hf.space"], label="Choose/Cancel type any .hf.space link here (can also type a link)'", allow_custom_value=True)
2026
  chatspacebtn = gr.Button("Use the chosen URL to load interface with a chat model. For sdk.vercel click the chat button on the top left. For lymsys / chat arena copy the link and use a new tab")
2027
  with gr.Accordion("Some prompt ideas", open=False):
2028
  with gr.Accordion("Prompts in text (Manual copy paste)", open=False):
 
2045
  #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2046
  with gr.Row():
2047
  with gr.Column(scale=1):
2048
+ gr.HTML(""" <div style="height: 350px; width: 100%; border: 1px solid black; overflow: auto;"> Some useful links <br> <a href='https://github.com/eugeneyan/open-llms'> -- Opensource List -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard'> -- Open LLM Leaderboard -- </a> | <a href='https://openxlab.org.cn/apps'> -- Openxlabs - Huggingface Alternative -- </a> | <a href='https://huggingface.co/spaces/sanchit-gandhi/whisper-jax'> -- Whisper JAX -- </a> | <a href="https://translate.google.com/?hl=en&tab=TT"> -- Google Translate -- </a> | <a href='https://huggingface.co/spaces/damo-vilab/modelscope-text-to-video-synthesis'> -- Modelscope Text to Video -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion'> -- stable-diffusion 2 -- </a> | <a href='https://huggingface.co/spaces/stabilityai/stable-diffusion-1'> -- stable-diffusion 1 -- </a> | <a href='https://huggingface.co/spaces/kakaobrain/karlo'> -- karlo 1 -- </a> | <a href='https://huggingface.co/spaces/suno/bark'> -- Bark (TTS) -- </a> | <a href='https://chat.lmsys.org/'> -- Offline Text Model Demos -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a> | <a href='https://beta.elevenlabs.io/'> -- Eleven Labs -- </a> | <a href='https://www.d-id.com/'> -- Animate an Image -- </a> | <a href='https://voice.ai/'> -- Clone a voice -- </a> | <a href='https://openai.com/pricing'> -- OpenAI pricing -- </a> | <a href='https://huggingface.co/spaces/sohojoe/soho-clip-embeddings-explorer'> -- Image Training Data Search -- </a> | <a href='https://huggingface.co/spaces/huggingchat/chat-ui'> -- Huggingface Chat -- </a> | <a href='https://huggingface.co/spaces/bguisard/stable-diffusion-nano'> -- 128x128 Stable Diffusion (Fast) -- </a> | <a href='https://huggingface.co/spaces/colonelwatch/abstracts-index'> -- Search 95 million research abstracts -- </a> | <a href='https://huggingface.co/datasets/roneneldan/TinyStories'> -- Tiny Stories Dataset -- </a> | <a href='https://huggingface.co/spaces/lykeven/visualglm-6b'> -- Visualglm6b - Discuss images -- </a> | <a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/camenduru/potat1'> -- Potat1 Text2vid -- </a> | <a href='https://twitter.com/willdepue/status/1661781355452325889'> -- Alexandria Prohect (Will Deque) - Free Embeddings -- </a> | <a href='https://artsandculture.google.com/'> -- Google Arts and Culture Portal -- </a> | <a href='https://huggingface.co/spaces/Matthijs/whisper_word_timestamps'> -- Word Level Timestamps -- </a> | <a href='https://huggingface.co/spaces/zaanind/NLLB-translation'> -- NLLB 600M Demo -- </a> = <a href='https://github.com/facebookresearch/fairseq/tree/nllb'> -- NLLB Github -- </a> | <a href='https://huggingface.co/spaces/hysts/zeroscope-v2'> -- Zeroscope v2 Text to video -- </a> | <a href='https://huggingface.co/spaces/SpacesExamples/ComfyUI'> -- ComfyUI Text to Image -- </a> | <a href='https://huggingface.co/spaces/DeepFloyd/IF'> -- Deepfloyd IF - Text in image -- </a> | <a href='https://huggingface.co/spaces/ysharma/ChatGPT-Plugins-in-Gradio'> -- ChatGPT Custom Plugins Test Space -- </a> | <a href='https://www.reddit.com/r/LocalLLaMA/'> -- r/LocalLlama -- </a> | <a href='https://www.reddit.com/r/singularity/'> -- r/Singularity -- </a> | <a href='https://huggingface.co/spaces/hysts/SD-XL'> -- SD-XL Test Space -- </a> | <a href='https://huggingface.co/spaces/facebook/seamless_m4t'> -- Seamless M4T - Translation one stop shop -- </a> | <a href='https://huggingface.co/spaces/codellama/codellama-playground'> -- Code Llama playground -- </a> | <a href='https://huggingface.co/spaces/Voicemod/Text-to-Sing'> -- Text to sing -- </a> | <a href='https://huggingface.co/spaces/camenduru-com/webui'> -- Stable Diffusion Webui (Camenduru Space) -- </a> | <a href='https://huggingface.co/spaces/ysharma/WizardCoder34b'> -- Wizard Coder 34B -- </a> | <a href='https://huggingface.co/spaces/chansung/co-write-with-llama2'> -- Cowrite with llama2 -- </a> | <a href='https://huggingface.co/spaces/fffiloni/Image-to-Story'> -- Image to Story -- </a> | <a href='https://huggingface.co/spaces/fffiloni/CLIP-Interrogator-2'> -- Clip interrogator 2 -- </a> | <a href='https://github.com/THUDM/AgentBench'> -- Agent Benchmarks -- </a> | <a href='https://www.convex.dev/ai-town'> -- AI Town Live Demo -- </a> = <a href='https://github.com/a16z-infra/ai-town'> -- AI Town Repository (Deployment]) -- </a> | <a href='https://github.com/joonspk-research/generative_agents/tree/main'> -- Generative Agents: Interactive Simulacra of Human Behavior (Research paper Repository) -- </a> | <a href='https://huggingface.co/spaces/HuggingFaceM4/idefics_playground'> -- IDEFICS - open Multimodal model -- </a> | <a href='https://github.com/facebookresearch/belebele'> -- Belebele (Meta Dataset) -- </a> | <a href='https://huggingface.co/spaces/jbilcke-hf/ai-comic-factory'> -- AI Comic Factory -- </a> | <a href='https://github.com/camenduru'> -- CAMENDURU REPOS -- </a> | <a href='https://huggingface.co/datasets/b-mc2/sql-create-context'> -- SQL Dataset - A list of simple questions -- </a> | <a href='https://github.com/KillianLucas/open-interpreter'> -- Open Interpreter (alt to ChatGPT Pro) -- </a> | <a href='https://easywithai.com/fun-ai-tools/'> -- List - Easy with AI -- </a> | <a href='https://huggingface.co/spaces/Xenova/whisper-web'> -- Whisper Web (UI) -- </a> | <a href='https://blog.roblox.com/2023/09/revolutionizing-creation-roblox/'> -- Roblox Assistant -- </a> | <a href='https://huggingface.co/spaces/AP123/IllusionDiffusion'> -- Illusion Diffusion (Hide words or shapes in the image) -- </a> | <a href='https://huggingface.co/spaces/Shopify/background-replacement'> -- Background replacement - Shopify -- </a> | <a href='https://huggingface.co/spaces/multimodalart/LoraTheExplorer'> -- Lora The Explorer (SDXL) -- </a> | <a href='https://huggingface.co/spaces/XCLiu/InstaFlow'> -- InstaFlow (Under 1 second Inference) -- </a> | <a href='https://github.com/tairov/llama2.mojo'> -- TinyStories on mojo (230+ tk/s) -- </a> | <a href='https://emojis.alexandru.so/p/OHVEmfMwQl'> -- Any Emoji you want - emojijs -- </a> | <a href='https://huggingface.co/spaces/google/sdxl'> -- SDXL on TPUv5 -- </a> | <a href='https://huggingface.co/spaces/SimianLuo/Latent_Consistency_Model'> -- LCM - SD1.5 at 7secs per 4 images (after coldstart) -- </a> | <a href='https://huggingface.co/spaces/fffiloni/sdxl-control-loras'> -- SDXL Control Lora -- </a> | <a href='https://huggingface.co/spaces/aadnk/faster-whisper-webui'> -- Whisper WebUI -- </a> | <a href='https://huggingface.co/spaces/guoyww/AnimateDiff'> -- AnimateDiff: Create an image make a video -- </a> | <a href='https://huggingface.co/spaces/facebook/seamless-m4t-v2-large'> -- Seamless m4t v2 -- </a> | <a href='https://huggingface.co/spaces/Otter-AI/OtterHD-Demo'> -- OtterHD: Multimodal model -- </a> | <a href='https://ai.meta.com/blog/ego-exo4d-video-learning-perception/'> -- Ego-exo4d Multimodal dataset -- </a> | <a href='https://imagine.meta.com/'> -- Meta Imagine images (Free) -- </a> | <a href='https://www.mage.space/'> -- Mage Space images (Free) -- </a> | <a href='https://www.bing.com/images/create?FORM=GENILP'> -- Bing Image Creator (Free) -- </a> | <a href='https://jalammar.github.io/'> -- Jay Alammar Blog - Illustrated Transformer, Stable Diffusion and More -- </a> | <a href='https://huggingface.co/spaces/myshell-ai/OpenVoice'> -- OpenVoice - Open Source Voice Clone -- </a> | </div>""")
2049
  with gr.Tabs() as nav1:
2050
  with gr.Tab("Rep - HTML"):
2051
  gr.HTML("UNWFWO = Unknown Native Word Foreign Word Order i.e. during active listening practice you only need the words you dont know")
 
2083
  #-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2084
  with gr.Column(scale=3):
2085
  with gr.Tab("General Idea"):
2086
+ gr.HTML("<b>FINAL VERSION = Image placeholder + Merged Images + Side by Side Audio + UNWFWO Reader script + Spotify/Youtube integration in one interface</b> <br>True mastery is from the relations between each item aka how every word relates to each other - Repitition in the form combinatorics - llm turns these into full sentences / ideas ")
2087
+ gr.HTML("Focus = Thinking = Audio = Repitition = This space is just ideas for optimising the audio content. - Audio of side by side version -- listen till you can say the foreign before the audio plays it (Knowledge version is Glossary as vocab you must mastering before reading)")
2088
+ with gr.Accordion("Some Current Incomplete Tests", open=False):
2089
+ with gr.Group():
2090
+ gr.HTML("Stable LM 2 zephyr 1.6 Placeholder - llama-cpp-python issues locally")
2091
+ gr.Interface(fn=lambda name: f"Placeholder to talk to Stable LM. Prompt = {name}", inputs="text", outputs="text")
2092
+ gr.Interface(fn=whisperlocaltts, inputs="file", outputs="text", description="Incomplete - Whisper base Test - Can record and then copy the text for use")
2093
+ gr.HTML('Memorisation by string comparison idea <br><br>Result of prompt chain starting with: Lets say I have the strings "red" and "ppalgan" how can I guess the second from the first from just spelling (eg. similar words and distance in the alphabet, ...), how can I use python to do this i.e. output of no matching letters, closest letter to r, then e, then d, a dictionary of letters that look similar eg. d and p, l and I a and d etc.')
2094
  gr.Interface(fn=letterbased_guess_word, inputs=["text", "text"], outputs="text", description="letter based guess suggestions (one word to one word is the designed use case)")
2095
  gr.HTML("Side by side reading creator (Google Translate) TODO - Roman output of Non roman characters")
2096
  with gr.Group():
2097
  with gr.Row():
2098
  #gr.Interface(fn=w4wsidebysidereadergen, inputs=["text", w4wsidebysidelangdest], outputs=["text", "text", "text"], description="Side by side reading creator")
2099
+ w4wsidebysideinput = gr.Text(label="Paste Text you want to learn here (wordlists and UDHR can be used as )", placeholder="Enter Text Here. One or Two Paragraphs at the longest ideally")
2100
  with gr.Row():
2101
  w4wsidebysidelangdest = gr.Dropdown(choices=langdropdown_choices, label="Choose destination language", value="de: german")
2102
+ #w4wsidebysideaudiosidebyside = gr.Checkbox(label="Audio for side by side")
2103
  w4wsidebysidebtn = gr.Button("Create Side by Side, FWNWO, and FWFWO (Just read start to finish of each till you can read the FWFWO without assistance)")
2104
  with gr.Row():
2105
  w4wsidebysideOutput = gr.Text(label="Side by side", placeholder="Side by side will display here")
2106
  w4wsidebysideFWNWOOutput = gr.Text(label="Foreign Word Native Word Order", placeholder="FW NWO will display here")
2107
  w4wsidebysideFWFWOOutput = gr.Text(label="Foreign Word Foreign Word Order", placeholder="FW FWO will display here")
 
2108
  with gr.Row():
2109
+ w4wsidebysideaudioOutput = gr.Audio(sources=["upload"], label="Side by Side in Audio form")
2110
+ with gr.Row():
2111
+ w4wsidebysideAnalysisPromptOutput = gr.Text(label="Prompt for LLM analysis", placeholder="Prompt for LLM analysis will display here")
2112
+ w4wsidebysidebtn.click(fn=w4wsidebysidereadergen, inputs=[w4wsidebysideinput, w4wsidebysidelangdest], outputs=[w4wsidebysideOutput, w4wsidebysideFWNWOOutput, w4wsidebysideFWFWOOutput, w4wsidebysideaudioOutput, w4wsidebysideAnalysisPromptOutput])
2113
+ with gr.Row():
2114
+ gr.HTML("To be Added")
2115
+ with gr.Row():
2116
+ w4wsidebysideNatSentStructOutput = gr.Text(label="Native Closed class words as Native Sentence Structure", placeholder="Comparison is valuable")
2117
+ w4wsidebysideForSentStructOutput = gr.Text(label="Foreign Closed class words as Foreign Sentence Structure", placeholder="Comparison is valuable")
2118
  with gr.Row():
2119
  w4wsidebysideWordCountOutput = gr.Text(label="Word Count", placeholder="Word Count will display here")
2120
  w4wsidebysideRandomisedOutput = gr.Text(label="Random Order As Test", placeholder="Randomised version (Transition Tab most left bottom) will display here")
2121
  w4wsidebysideQueGenOutput = gr.Text(label="Questions generation as comprehension test", placeholder="Questions generated will display here")
2122
  w4wsidebysideUNWFWOOutput = gr.Text(label="HTML as UNWFWO assistant", placeholder="HTML as UNWFWO assistant download will display here")
2123
+ gr.HTML("Side by side reading creator (NLLB-600M (+-3gb / setting has 400 tokens? as max length for inference optimisation?)- 200 languages vs 107 in googletrans) - <a href='https://github.com/facebookresearch/fairseq/tree/nllb'> -- Fairseq Github -- </a> | inspired by - <a href='https://huggingface.co/spaces/Geonmo/nllb-translation-demo'> -- Geonmo NLLB Demo -- </a> | <a href='https://huggingface.co/spaces/vutuka/nllb-vutuka-translation'> -- Vutuka demo -- </a>")
2124
  with gr.Group():
2125
  gr.HTML("Under Construction - generator and cpu based to beat gpu cost, cpu wait time and network dependency for local use")
2126
  nllbtranscpuinput = gr.Text(label="Paste Text you want to learn here (wordlists and UDHR can be used as )", placeholder="Enter Text Here")
2127
  with gr.Row():
2128
+ nllbtranscpubtnword4word = gr.Button("Create Side by Side Translation")
2129
  nllbtranscpulangsrc = gr.Dropdown(choices=nllb_lang_codes, label="Choose source language", value="English")
2130
  nllbtranscpulangdest = gr.Dropdown(choices=nllb_lang_codes, label="Choose target language", value="Akan")
2131
+ #nllbtranscpuword4word = gr.Checkbox(label="word for word?")
2132
+ nllbtranscpubtn = gr.Button("Create Whole Translation (FWFWO)")
2133
  with gr.Row():
2134
+ with gr.Column(): #scale=4
2135
+ nllbtranscpudetailsword4wordOutput = gr.Text(label="Side by side Inference Details", placeholder="Side by side Inference Details will display here")
2136
+ nllbtranscpuOutputword4word = gr.Text(label="Side by side", placeholder="Side by side will display here")
2137
+ with gr.Column():
2138
  nllbtranscpudetailsOutput = gr.Text(label="Inference Details", placeholder="Details will display here")
2139
+ nllbtranscpuOutput = gr.Text(label="Whole Translation of text", placeholder="Whole Translation will display here")
2140
+ nllbtranscpubtnword4word.click(fn=nllbtransctranslationoptionalw4w, inputs=[nllbtranscpulangsrc, nllbtranscpulangdest, nllbtranscpuinput], outputs=[nllbtranscpuOutputword4word, nllbtranscpudetailsword4wordOutput])
2141
  nllbtranscpubtn.click(fn=nllbtransctranslation, inputs=[nllbtranscpulangsrc, nllbtranscpulangdest, nllbtranscpuinput], outputs=[nllbtranscpuOutput, nllbtranscpudetailsOutput])
2142
  gr.Interface(fn=LoadNLTKUDHRText, inputs=NLTKudhr, outputs=["text", "textarea"], description="UDHR as some test texts")
2143
  with gr.Tab("Youtube Subs Listening Comprehension"):
 
2147
  gr.HTML(" <a href='https://huggingface.co/spaces/artificialguybr/VIDEO-TRANSLATION-TRANSCRIPTION'> -- artificialguybr's Video Translation/Transcription Space -- </a> | ")
2148
  with gr.Group():
2149
  gr.HTML("Custom Subtitles Ideas - Realtime Practice = Test (Pause to learn)")
2150
+ YTTransciptOutDropdown = gr.Dropdown(choices=["https://www.youtube.com/watch?v=UYk43fncV68", "https://youtu.be/dxVaP0-aFIE"], value="https://www.youtube.com/watch?v=UYk43fncV68", allow_custom_value=True)
2151
  YTTransciptOutbtn = gr.Button("Transcript to text")
2152
  YTTransciptOutVid = gr.HTML('Video will load Here')
2153
  gr.Interface(fn=subtitle_generator, inputs=None, outputs=["textbox", "textbox", "textbox"], description='Modified Subtitles Test - will only work after video has been loaded')
 
2202
  gr.HTML("For Audio Most productive is real time recall of native (where your full reasoning ability will always be) <br><hr> Find Replace new lines of the foreign text with full stops or | to get per word translation")
2203
  gr.Interface(fn=TTSforListeningPractice, inputs=["text", TTSLangOptions2], outputs="audio", description="Paste only english words in foreign order and then keep removing the words from this to practice as effectively")
2204
  with gr.Tab("Speed through Imagery"):
2205
+ gr.HTML("<a href='https://chat.openai.com/g/g-bYMSVlb8y-lingua-link'> -- Lingua Link (Simple GPT for assistinng image creation) -- </a> <br>Use with placeholder generator tab below <br> Best for this is 2 nouns as one phrase i.e. nouns as adjectives and then you can a verb (1000 of those will take you far)")
2206
+ with gr.Accordion("More Details - conversation example", open=False):
2207
+ gr.Gallery(show_label=True, value=["adult-child-seong-in-namseong-DALL·E 2024-01-17.png", "adult child seong-in namseong DALL·E 2024-01-17 00.33.56.png", "adult (ɔpanyin) child (mmɔfra) DALL·E 2024-01-17 01.08.59.png", "adult (ɔpanyin) child (mmɔfra) DALL·E 2024-01-17 00.59.41.png"], label="Lingua Link Output - Mixed Spelling through Images")
2208
+ gr.HTML(""" <h1>Adult Child is Seong-in Namseong</h1>
2209
+ <p>How do we visualize this in one image?</p>
2210
+ <h2>GPT's Concept</h2>
2211
+ <p>To visualize "adult child" translated to "seong-in namseong" in Korean, we can create an image that creatively incorporates elements representing both an adult and a child. Here's a concept:</p>
2212
+ <ul>
2213
+ <li><strong>Scene:</strong> A park setting with a clear distinction between two halves.</li>
2214
+ <li><strong>Adult Side:</strong> One half shows an adult man in a business suit, holding a briefcase, standing near a bench with a newspaper and a cup of coffee.</li>
2215
+ <li><strong>Child Side:</strong> The other half shows a young boy, dressed in playful, colorful clothes, holding a toy airplane, standing near a sandbox with a bucket and spade.</li>
2216
+ <li><strong>Transition Element:</strong> A tree in the middle, with its leaves transitioning from green (adult side) to vibrant colors (child side), symbolizing the growth and change from childhood to adulthood.</li>
2217
+ </ul>
2218
+ <p>This image will represent the concept of an "adult child" or "seong-in namseong" by juxtaposing the characteristics of both stages of life.</p>
2219
+ <h3>User's Inquiry</h3>
2220
+ <p>Thats but where are the near spelled words?</p>
2221
+ <h3>GPT's Revised Concept</h3>
2222
+ <p>To incorporate words that are spelled similarly to "seong-in namseong," I will first find words in English that are close in spelling to the Korean phrase. Here are three words that somewhat resemble "seong-in namseong" in spelling:</p>
2223
+ <ol>
2224
+ <li>Singing - Resembles 'seong-in' in the sound and somewhat in spelling.</li>
2225
+ <li>Seasoning - Shares some similarity in spelling and phonetics with 'seong-in namseong'.</li>
2226
+ <li>Song - Similar to 'seong' in 'seong-in'.</li>
2227
+ </ol>
2228
+ <p>Now, let's integrate these words into the image concept:</p>
2229
+ <ul>
2230
+ <li><strong>Singing:</strong> The adult can be depicted as softly singing or humming a tune, perhaps with a subtle musical note symbol floating in the air.</li>
2231
+ <li><strong>Seasoning:</strong> The child could be playfully pretending to cook in the sandbox, with toy seasoning bottles.</li>
2232
+ <li><strong>Song:</strong> There could be a book or a sheet of music with a song's title visible, lying on the bench beside the adult.</li>
2233
+ </ul>
2234
+ <p>This revised concept includes elements related to the words "singing," "seasoning," and "song," which are visually connected to the original phrase "seong-in namseong."</p>
2235
+ """)
2236
+ gr.Interface(fn=lingualinkassist, inputs=["text","text"], outputs="text", description="Lingua Link Prompt Assistance (Simple Prompts)")
2237
  with gr.Tab("Filter Text"):
2238
+ gr.HTML("Categories for Image Creation <br>1. Extract only nouns <br>2. Extract Acronyms <br>3. Convert verbs to Careers <br>Dall-E 3 best for multi concept images - every thing else = one picture at a time <br>Ask the llm to create a prompt from the nouns extracted or to create english words ot sentences from the acronyms")
2239
  gr.Interface(fn=onlyplurals, inputs=["text"], outputs=["text"], description="Only plurals = optimal concepts to learn first as LT work = repitition")
2240
  gr.Interface(fn=create_acronym_map, inputs="textbox", outputs="textbox", description="Acronyms")
2241
  gr.Interface(fn=keep_nouns, inputs="textbox", outputs="textbox", description="Nouns only")
2242
  with gr.Tab("Placeholder Genration"):
2243
+ gr.HTML("Placeholder for every image of each sentence - Good for ChatGPT + Dall-E (First 16 Characters is part of the filename if you get error)")
2244
  with gr.Row():
2245
  with gr.Column(scale=4):
2246
+ imageplaceholderinput = gr.TextArea(placeholder="Enter Text and Get a line by line (stand in for sentences for now) placeholder for image associated with the text")
2247
  with gr.Column(scale=1):
 
2248
  imageplaceholderdownload = gr.File()
2249
  imageplaceholderbtn = gr.Button("Create the image placeholder")
2250
  with gr.Row():
 
2254
  imageplaceholdertextoutput = gr.Code("The code for the HTML created will come here")
2255
  imageplaceholderbtn.click(fn=imagebasedreading, inputs=[imageplaceholderinput], outputs=[imageplaceholderdownload, imageplaceholderoutput, imageplaceholdertextoutput])
2256
  with gr.Tab("Word level Placeholder Genration"):
2257
+ gr.HTML("Placeholder for every image of each word - Good for ChatGPT + Dall-E (First 16 Characters is part of the filename if you get error)")
2258
  with gr.Row():
2259
  with gr.Column(scale=4):
2260
+ imageplaceholderinputwordlevel = gr.TextArea(placeholder="Enter Text and Get a word by word placeholder for image associated with the text")
2261
  with gr.Column(scale=1):
 
2262
  imageplaceholderdownloadwordlevel = gr.File()
2263
  imageplaceholderbtnwordlevel = gr.Button("Create the image placeholder")
2264
  with gr.Row():
 
2268
  imageplaceholdertextoutputwordlevel = gr.Code("The code for the HTML created will come here")
2269
  imageplaceholderbtnwordlevel.click(fn=imagebasedreadingwordlevel, inputs=[imageplaceholderinputwordlevel], outputs=[imageplaceholderdownloadwordlevel, imageplaceholderoutputwordlevel, imageplaceholdertextoutputwordlevel])
2270
  with gr.Tab('Picture Subtitles / Image Slide Show'):
2271
+ gr.HTML("----------------------------------INCOMPLETE------------------------------------ <br>runs into filepath error - The console error and download link in the files component in app have different paths and I dont know how to get the path in the interface")
2272
  gr.Interface(fn=speedmastery_load_images, inputs=speedmastery_load_imagesinput, outputs="gallery", description="Put the images you want to practice or work on")
 
2273
  gr.HTML('placeholder for button to start generator for time based image recognition i.e. Picture Subtitles')
 
2274
  with gr.Tab("UNWFWO - Stateful Reading - Progress Tracking"):
2275
+ gr.HTML("The problem is to learn you need to repeat things you know that you didnt know this morning - Repititionis only half of solution <br>You need to read new stuff while revising the stuff you didnt know that you just learned aka the things you write as notes <br> Blended Images can help")
2276
+ gr.Interface(fn=UnknownTrackTexttoApp, inputs="text", outputs=["file", "html", "code"], description="HTML mini App - UNNWFWO (English grammar only for now)(To track verbs you dont know for listening practice). Use the text from here to create lists you use for the TTS section")
2277
+ gr.Interface(create_acronym_map, inputs='text', outputs=['text', 'text'], description="Acronym Map Generator (per line)")
2278
  gr.HTML("The sentences used as notes repitition interface then can count as recently known sentences that you can ignore in favour of the sentences you didnt interact with")
2279
  gr.Label("Some Tests - click to hide - unknown word only list")
2280
+ gr.HTML("------------INCOMPLETE (javascript doesnt and unhide proprely)------------------------")
2281
  gr.Interface(fn=hidingbuttontesttranslate, inputs="text", outputs=["code", "html"])
 
 
 
2282
  gr.HTML("On the Acronyms you need to underline the verbs")
2283
  gr.HTML("Aim for 1000 reps per item in your mind - the end goal for full sentences is to identify the SOV equivalent ASAP")
2284
  gr.Interface(fill_lines, inputs=["text", RepSched_Num_lines], outputs="text")
2285
  with gr.Tab("Kinesthetic / Mime Translation"):
2286
+ gr.HTML("placeholder for prompt generator and tests for llama-cpp with slm OR even opencv + a face open pose comparison to viseme face open pose structure")
2287
  gr.HTML("Keep nouns and verbs -- turn every noun into a verb -- turn every verb into a pose")
2288
+ gr.HTML("""Viseme Test with video recording screenshots judged LMM <br><br> # https://melindaozel.com/viseme-cheat-sheet/
2289
+ <br><br> # https://developer.oculus.com/documentation/unity/audio-ovrlipsync-viseme-reference/
2290
+ <br><br> # https://docs.aws.amazon.com/polly/latest/dg/viseme.html
2291
+ <br><br> # https://docs.aws.amazon.com/polly/latest/dg/speechmarkexamples.html
2292
+ <br><br> # https://docs.aws.amazon.com/polly/latest/dg/ref-phoneme-tables-shell.html
2293
+ <br><br> # https://docs.aws.amazon.com/polly/latest/dg/ph-table-english-za.html
2294
+ <br><br> # https://docs.aws.amazon.com/polly/latest/dg/ph-table-korean.html""")
2295
  with gr.Tab("Beginner - Listen + Read"):
2296
  gr.Label("Closed Eye Recital per new word | 1 new word a minute while recycling the words from the previous minutes")
2297
  with gr.Row():
 
2423
  gr.Interface(fn=create_collapsiblebutton, inputs=["textbox", "textbox", "textarea"], outputs="textbox", description="Button and Div HTML Generator, Generate the HTML for a button and the corresponding div element.")
2424
  with gr.Tab("Real-Time AI - Video/Audio/AR"):
2425
  gr.HTML("<div style='display: flex; justify-content: center; align-items: center; height: 100%;'> Agents = Custom Software (Personalised UI and Mods, among other things) = Custom Environments (AR) <a href='https://github.com/KillianLucas/open-interpreter'> -- Open Interpreter -- </a> | <a href='https://github.com/microsoft/autogen'> -- Microsoft Autogen -- </a> | </div>")
2426
+ gr.HTML("Steerable Surveillance system = Assistant --- people will need to manage their own infrastructure or risk total invasion of privacy")
2427
+ gr.HTML("Cheap: Raspberry Pi / Pydroid and OpenCV and Tkinter = Frontend for OpenAI / OSS vision API as ChatGPT doesnt support video / real-time screenshot yet <br>Expensive - XREAL Air 2, Quest 3, Vision Pro, ")
2428
  gr.HTML("HUD Experiment (Waiting for GPT4V API) - Full context of user situation + Ability to communicate in real-time to user using images (H100+ and low enough resolution and low enough steps - it/s = fps) - just like google maps but for real life")
2429
+
2430
  gr.HTML("Some sample Open Interpreter Code - https://huggingface.co/spaces/ysharma/open-interpreter/blob/main/app.py")
2431
  gr.Interface(fn=ImageTranslationTest , inputs=[VideoTestInput, VideoTestSubtitleInput], outputs="video")
2432
  with gr.Accordion("STT Spaces (sanchit-gandhi spaces have microphone input)"):
 
2447
  gr.HTML("<a href='https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text'> -- RAM and Tag2Text -- </a> | <a href='https://huggingface.co/spaces/curt-park/segment-anything-with-clip'> -- SAM with Clip -- </a>")
2448
  with gr.Tab("Incomplete Tests and Experiments"):
2449
  with gr.Tab("Multi Output and other ideas"):
2450
+ with gr.Row():
2451
+ with gr.Column():
2452
+ gr.HTML("Test using gradio space/interfaces through the api as function calls for gpt3.5 and 4</b>")
2453
+ gr.HTML("Roblox as test for ability to describe? - <a href='https://blog.roblox.com/2023/09/revolutionizing-creation-roblox/'> -- Roblox Assistant -- </a> | <br> ")
2454
+ gr.HTML("State Management and Education <br> Education = Learning things you didnt know yesterday and not forgetting more than you learn <br><br> What you didnt know forms = <br> Glossary <br> Lists <br> Formulas <br> graphs <br> Procedures <br> <br> for each you will need a seperate way to track the progress but amount of times + recency = approximate state ")
2455
+ with gr.Column():
2456
+ gr.HTML("<span style:{'fontsize: 20'}>Start at Unkown Tracker if unseure<span> <br> UNNWFWO = Unknown Native Word Foreign Word Order i.e. during active listening practice you only need the words you dont know <br><br> General Ideas in this space - Speed of Learning = Avoid Things you know like the plague -- How to track what you know -- Counter is easiest and How you feel is the hardest (The more you know, the more confusion on what you dont know as you probably werent keeping track) <br><br> Visulisation of long text - Bottom of this page <br> Wordlist - 1 new word at a time per minute in the space to the left <br> Youtube Video Watching - Subtitles Tab <br> Reading - Unknown Tracker Tabs <br> Longer Text Memorising - Acronym Map Creation Tab and Transition Tab <br> Brainstorming - Reading Assistant <br> Random Exposure <br> ")
2457
  gr.Interface(fn=MultiOutputInterface, inputs=TestSplitandUpdateinput, outputs=["button", "text", "text", "text", "text", "text", "text", "text", "text", "text"])
2458
  with gr.Tab("Order based Forcing content into time (Time is the bottleneck)"):
2459
  gr.Label("Inspect the Transition Tab last item in left most column - RandomiseTextbyType - Incomplete, but this plus timer will work well achieve what this space aims to achieve - LLMs would choose the next set of words based on the last batch and its knowledge of your vocab level or even your current location (using phone as sensors) and can make image/audio prompts to make more engaging")
 
2469
  gr.HTML("Tree and Branches approach to learning = familiarity with keywords/headings/summaries before reading the whole text <hr> Productivity/Work revolves around repitition which can be found looking for plurals and grouping terms eg. Headings and Hyper/Hyponyms Analysis")
2470
  gr.HTML("Sentence to PyDot graph")
2471
  gr.HTML("Currently a bug that locks all buttons in the space when you use this above example - Reload to fix")
 
 
 
 
 
 
 
 
 
 
 
2472
  #with gr.Tab("Gradio Client Tests"):
2473
  # gr.HTML("How to return componets here in gradio (as each client interface needs different inputs) like in react")
2474
  with gr.Tab("Current Ideas to edit old sections"):
 
2477
  gr.HTML("Parts that are not done - Visualisation (of acronyms / duo word sets / nouns and verbs) - The image placeholder creator script, Tracking (private = database, public = textfile export), calendar based scheduling aka alert based ")
2478
  gr.HTML("React Version of the app can combine all of these use cases into one component - so far tracking, placeholder and partially scheduling have been done")
2479
  gr.Label('True speed simultaneous - which is a boolean state = practice at simulataneous to get simultaneous |||| Another way to be fast is to practice simultaneously with the varios SOVs i.e. when you read a noun the verb must appear immediately and vice versa |||| Simultaneous Spelling is the other way to practice |||| The main goal of all reading is that next time you read you take less time this time: |||| Spped = ability to anticipate the next word |||| Anticipation of a sentence = POV |||| ')
2480
+ with gr.Accordion("Random Ideas"):
2481
+ gr.HTML("<hr>(Part to be formatted as System prompt for model used as the help admin for the app) Objective - Learn vocab from video/music and have record of how far you got using as overengineered solution (to keep upto date with SOTA AI models and use cases) <br>Current Workflow = One Youtube video as focus for a week or until learned (i.e. instant recognition recall of vocab in random order exposure) <br>Timeline Brainstorm = Know Nothing (Just need Exposure - Random 10% suggesed as starting point) --- Know a little (Remove known) --- Know half (UNNWFWO) <hr> ")
2482
+ gr.HTML("""<p>Spaces Test - Still Undercontruction --> Next Milestone is Turning this interface handsfree | Knowledge is a Language but productive knowledge is find replace as well | LingQ is good option for per word state management</p> <p> Arrows app json creator for easy knowledge graphing and spacy POS graph? --> Questions? -->
2483
+ <p> ChatGPT Turns Learning into a read only what you dont know ask only what you dont know feedback loop --> All you have to do is keep track of what prompts you have asked in the past</p> """)
2484
+ gr.HTML("<p>Target 0: Mnemonics as title of images --> Comprehensible input <br> Target 1: Dual audio at word Level while using repitition to train random recall --> Word level Time <br> Target 2: Video --> Split by sentence --> each word repeated (60) + each phrase (10) + each sentence (10) --> TTS file for practice --> State Management/Known word Tracker <br>-----------------------<br> The trick is minimum one minute of focus on a new word --> Listening is hard because there are new word within seconds and you need repeated focus on each to learn </p> <p>Audio = best long form attention mechanism AS it is ANTICIPATION (Awareness of something before it happens like knowing song Lyrics) FOCUSED - Attention (Focused Repitition) + Exposure (Random Repitition) </p> <p>Listening is hard due to different word order and word combinations (collocations more important than single words)</p> <hr>")
2485
+ gr.HTML("Predictable to identify the parts of picture being described --> The description moves in one direction from one side of the image to the other side is easiest <hr>")
2486
+ gr.HTML("Image = instant comprehension like Stable Diffusion --> Audiovisual experience is the most optimal reading experience <br> Manga with summary descriptions for the chapters = Most aligned visual to audio experience")
2487
  with gr.Tab("Simultanoues Practice Zone"):
2488
  gr.Label("Audio based space where you must look at the corresponding text for the audio thats playing as simultaneous practice")
2489
  gr.DataFrame(None, headers=["text", "audio"], label="Add text pairs to practice", interactive=True)
 
2496
  gr.Label("Placeholder for old code for concordance and word counting in other test space")
2497
  with gr.Tab("Video Segmentation with OpenCV Test"):
2498
  gr.Interface(fn=segment_video_with_opencv, inputs=VideoSplitTestInput, outputs=SplitVideoOutput, description="Split video into even increments for better study tracking ")
 
 
2499
  with gr.Tab('Acronym Map Creation Space'):
2500
  gr.HTML("Acronym cant be read with previous attentive reading - accurate measure of known vs unknown")
2501
  with gr.Row():
 
2521
  gr.Textbox(label='Use this text to hold translations of the SQL rows in the above linked dataset (A kind of What I say vs what I want)')
2522
 
2523
 
2524
+ lliface.queue().launch(share=True) #share=true) #docker #(inbrowser="true") #colab