Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
from graphviz import Digraph
|
3 |
|
4 |
-
|
5 |
st.markdown("""
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
# π Multiply your productivity by 100 times today using AI:
|
8 |
|
9 |
π Lets prove it with HuggingFace, Gradio, Streamlit, ChatGPT,and HTML/Javascript
|
@@ -11,48 +15,58 @@ My Progression:
|
|
11 |
1. 2021 - With AI Coding From Scratch **10 AI programs per year** = 1 AI Program per 36.5 days.
|
12 |
2. 2022 - Discovered HF Spaces. **200 AI Programs** = a little over .5 Programs per day.
|
13 |
3. 2023 - New process - **AI Pair Programming** ChatGPT+HF = 266 in Q1 (**1064 programs per year**)
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
17 |
1. **Record:** 30 working programs in 2 days on planned subject outline. (15/day)
|
18 |
2. Synopsis: Learning in the Loop - AI Pair programming expands your knowledge.
|
19 |
3. Use **Targeted AI vocabulary keywords** to generate domain specific code and text mashups.
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
# π HF Token - Create a new token in Settings for this code:
|
|
|
|
|
|
|
|
|
39 |
1. HF_TOKEN = os.environ.get("HF_TOKEN") # get token from secrets, copy token value HF_TOKEN from Profile settings token into this repo settings
|
40 |
2. generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B", api_key=HF_TOKEN) # add api_key=HF_TOKEN to get over the quota error
|
41 |
3. generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOKEN)
|
42 |
4. generator1 = gr.Interface.load("huggingface/gpt2-large", api_key=HF_TOKEN)
|
43 |
-
5. gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."),
|
44 |
-
title=title, examples=examples).launch(share=False)
|
45 |
|
46 |
# π Access Tokens:
|
47 |

|
48 |
|
49 |
-
# π Org Join:
|
50 |
-
1. Org: https://huggingface.co/CognitiveAIForHealth
|
51 |
-
2. Join Link: https://huggingface.co/organizations/CognitiveAIForHealth/share/LUIgWlwxqHYTeKWwVGOCaADIJNDBdtOfER
|
52 |
-
3. Observe - Verify if you show up in Team list.
|
53 |
-
|
54 |
# π Gradio Spaces - Lets set time records for copy/modify pattern
|
55 |
-
1. Concept, Examples, 3 AI Models: https://huggingface.co/spaces/awacke1/Sentence2Paragraph
|
56 |
2. Generative AI: https://huggingface.co/spaces/awacke1/Image-to-Line-Drawings
|
57 |
|
58 |
# π Easy Button in Model Pages - Model Bakeoffs with Gradio:
|
@@ -61,45 +75,51 @@ My Progression:
|
|
61 |
3. Open 3 in new tab, Deploy Spaces.
|
62 |
|
63 |
# π Top Copy and Modify Examples
|
64 |
-
|
|
|
|
|
65 |
1. **Cognitive, RLHF**: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/Cognitive-AI-Episodic-Semantic-Memory-Demo)
|
66 |
-
2. **Big Science Bloom**: https://huggingface.co/spaces/awacke1/BigScienceContinualGenerator
|
67 |
-
|
68 |
-
3. **Torch and Git**: https://huggingface.co/spaces/awacke1/Image-to-Multilingual-OCR
|
69 |
4. **Useful QA, NLP and Visualization Models**:
|
70 |
-
- Heatmap, Cluster: https://huggingface.co/spaces/awacke1/NLPSentenceSimilarityHeatmap
|
71 |
-
- QA Context: https://huggingface.co/spaces/awacke1/Question-answering
|
72 |
-
- Seq2Seq: https://huggingface.co/spaces/awacke1/4-Seq2SeqQAT5
|
73 |
-
- MLM: https://huggingface.co/spaces/awacke1/SOTA-MedEntity
|
74 |
-
5. **Mapbox with
|
|
|
|
|
|
|
|
|
75 |
|
76 |
-
# Curated Copy and Modify:
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
4. π©ΊβοΈ https://huggingface.co/spaces/awacke1/CloneAnyVoice
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
|
|
|
90 |
π©ΊβοΈ [ROUGE](https://huggingface.co/spaces/evaluate-metric/rouge)
|
91 |
π©ΊβοΈ [BLEU](https://huggingface.co/spaces/evaluate-metric/bleu)
|
92 |
|
93 |
-
|
94 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsMinnesota
|
95 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsNewJersey
|
96 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsMentalHealth
|
97 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-GraphViz-Folium-MapTopLargeHospitalsinWI
|
98 |
|
|
|
99 |
π©ΊβοΈ Game Activity Graph: https://huggingface.co/spaces/awacke1/CardGameActivity-GraphViz
|
100 |
π©ΊβοΈ SVG Card Generation: https://huggingface.co/spaces/awacke1/VizLib-SVGWrite-Streamlit
|
101 |
|
102 |
-
|
103 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/Assessment-By-Organs
|
104 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/SMART-FHIR-Assessment-Test2
|
105 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/FHIRLib-FHIRKit
|
|
|
1 |
import streamlit as st
|
2 |
from graphviz import Digraph
|
3 |
|
|
|
4 |
st.markdown("""
|
5 |
|
6 |
+
# π Org Join:
|
7 |
+
1. Org: https://huggingface.co/CognitiveAIForHealth
|
8 |
+
2. Join Link: https://huggingface.co/organizations/CognitiveAIForHealth/share/LUIgWlwxqHYTeKWwVGOCaADIJNDBdtOfER
|
9 |
+
3. Observe - Verify if you show up in Team list.
|
10 |
+
|
11 |
# π Multiply your productivity by 100 times today using AI:
|
12 |
|
13 |
π Lets prove it with HuggingFace, Gradio, Streamlit, ChatGPT,and HTML/Javascript
|
|
|
15 |
1. 2021 - With AI Coding From Scratch **10 AI programs per year** = 1 AI Program per 36.5 days.
|
16 |
2. 2022 - Discovered HF Spaces. **200 AI Programs** = a little over .5 Programs per day.
|
17 |
3. 2023 - New process - **AI Pair Programming** ChatGPT+HF = 266 in Q1 (**1064 programs per year**)
|
18 |
+
|
19 |
+
# π Conclusion: Over 100x with this simple recipe.
|
20 |
+
|
21 |
+
## π AI Pair Programming Process and Method:
|
22 |
+
|
23 |
+
When focused using AI to write outline, simplify outline, generate examples, debug and curate:
|
24 |
1. **Record:** 30 working programs in 2 days on planned subject outline. (15/day)
|
25 |
2. Synopsis: Learning in the Loop - AI Pair programming expands your knowledge.
|
26 |
3. Use **Targeted AI vocabulary keywords** to generate domain specific code and text mashups.
|
27 |
|
28 |
+
## π Prompt using domain technical knowledge to accelerate process of design and development.
|
29 |
+
|
30 |
+
## Favorite Quick and Easy prompting patterns:
|
31 |
+
|
32 |
+
**Markdown**
|
33 |
+
1. **Prompt:** Create a markdown cheat sheet that lists all the commands and short instructions for performing markdown code.
|
34 |
+
2. **Trouble** with code versus non code due to delimiters like triple apostrophe? Its using markdown.
|
35 |
+
3. **Prompt:** Show full code listing in markdown code with no comments
|
36 |
+
|
37 |
+
**Mermaid**
|
38 |
+
Organized, Sorted Graphs.
|
39 |
+
π https://huggingface.co/spaces/awacke1/MermaidModelHTML5Demo
|
40 |
+
1. **Python Streamlit** and Python gradio with code example input.
|
41 |
+
2. **Progressions** iterate with prompts to get what you want in a few steps..
|
42 |
+
3. **Prompt and Experiment:** Write an AI program using python, streamlit sklearn and keras to produce an AI program predicting sepal length.
|
43 |
+
4. **Curate and Revise:** Show full code listing. remove commentary. Make code listing as short as possible with few lines of code
|
44 |
+
5. **Reinforce and Teach:** Test and Share with HF to debug and test. Demonstrate and share links to others.
|
45 |
+
|
46 |
+
# **Why does this work?**
|
47 |
+
Copy and Modify Pattern, Mirroring, and the Human Brain.
|
48 |
+
|
49 |
+
# Cost of not innovating:
|
50 |
+
1. **Life Lessons** from Steel Manufacturing - Innovation, Productivity
|
51 |
+
2. **US Steel** - Cost of not changing and 5%
|
52 |
+
3. **Tata Steel** - Employment, Karma, and Legends
|
53 |
+
|
54 |
|
55 |
# π HF Token - Create a new token in Settings for this code:
|
56 |
+
|
57 |
+
Copy and Modify this Gradio AI Pipeline, Then Code Review:
|
58 |
+
https://huggingface.co/spaces/awacke1/Sentence2Paragraph
|
59 |
+
|
60 |
1. HF_TOKEN = os.environ.get("HF_TOKEN") # get token from secrets, copy token value HF_TOKEN from Profile settings token into this repo settings
|
61 |
2. generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B", api_key=HF_TOKEN) # add api_key=HF_TOKEN to get over the quota error
|
62 |
3. generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=HF_TOKEN)
|
63 |
4. generator1 = gr.Interface.load("huggingface/gpt2-large", api_key=HF_TOKEN)
|
64 |
+
5. gr.Parallel(generator1, generator2, generator3, inputs=gr.inputs.Textbox(lines=5, label="Enter a sentence to get another sentence."), title=title, examples=examples).launch(share=False)
|
|
|
65 |
|
66 |
# π Access Tokens:
|
67 |

|
68 |
|
|
|
|
|
|
|
|
|
|
|
69 |
# π Gradio Spaces - Lets set time records for copy/modify pattern
|
|
|
70 |
2. Generative AI: https://huggingface.co/spaces/awacke1/Image-to-Line-Drawings
|
71 |
|
72 |
# π Easy Button in Model Pages - Model Bakeoffs with Gradio:
|
|
|
75 |
3. Open 3 in new tab, Deploy Spaces.
|
76 |
|
77 |
# π Top Copy and Modify Examples
|
78 |
+
|
79 |
+
Lets set time records for copy/modify pattern - Get these running in your account.
|
80 |
+
|
81 |
1. **Cognitive, RLHF**: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/Cognitive-AI-Episodic-Semantic-Memory-Demo)
|
82 |
+
2. **Big Science Bloom**: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/BigScienceContinualGenerator)
|
83 |
+
3. **Torch and Git**: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/Image-to-Multilingual-OCR)
|
|
|
84 |
4. **Useful QA, NLP and Visualization Models**:
|
85 |
+
- Heatmap, Cluster: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/NLPSentenceSimilarityHeatmap)
|
86 |
+
- QA Context: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/Question-answering)
|
87 |
+
- Seq2Seq: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/4-Seq2SeqQAT5)
|
88 |
+
- MLM: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/SOTA-MedEntity)
|
89 |
+
5. **Mapbox with AIPP Prompting Tips**: [Example π©ΊβοΈ](https://huggingface.co/spaces/awacke1/StreamlitPydeckMapVisualViewStateForLatitudeLongitude)
|
90 |
+
6. **Clinical Terminology** NER: [Example π©ΊβοΈNLP Clinical Ontology Biomedical NER](https://huggingface.co/spaces/awacke1/Biomed-NLP-AI-Clinical-Terminology)
|
91 |
+
|
92 |
+
# π Curated Copy and Modify Advanced Real Time Video AI:
|
93 |
+
π©ΊβοΈ Yolo Real Time Image Recognition from Webcam: https://huggingface.co/spaces/awacke1/Webcam-Object-Recognition-Yolo-n-Coco
|
94 |
|
95 |
+
# π Curated Copy and Modify Advanced NLP ASR Examples:
|
96 |
+
1. π©ΊβοΈ https://huggingface.co/spaces/awacke1/ASR-High-Accuracy-Test
|
97 |
+
2. π©ΊβοΈ https://huggingface.co/spaces/awacke1/TTS-STT-Blocks
|
98 |
+
3. π©ΊβοΈ https://huggingface.co/spaces/awacke1/CloneAnyVoice
|
|
|
99 |
|
100 |
+
# π Curated Copy and Modify - NLP and QA
|
101 |
+
1. β **π©ΊβοΈ Question answering** - Answer questions posed in natural language. [Example](https://huggingface.co/spaces/awacke1/Question-answering)
|
102 |
+
2. π **π©ΊβοΈ Text classification** - Classify text into different categories. [Example](https://huggingface.co/spaces/awacke1/sileod-deberta-v3-base-tasksource-nli)
|
103 |
+
3. π¬ **π©ΊβοΈ Text generation** - Generate natural language text. [Example](https://huggingface.co/spaces/awacke1/Sentence2Paragraph)
|
104 |
+
4. π **π©ΊβοΈ Generation of new data**: Create new data that resembles existing data. [Example](https://huggingface.co/spaces/awacke1/GenAI-Generate-New-Data-Resembling-Example)
|
105 |
+
5. π **Data synthesis**: Synthesize data from multiple sources to create new datasets. [Example](https://huggingface.co/spaces/awacke1/Data-Synthesizer-Synthesize-From-Multiple-Sources)
|
106 |
+
6. π **π©ΊβοΈ Data augmentation**: Augment existing datasets to make them larger and more diverse. [Example](https://huggingface.co/spaces/awacke1/Data-Augmentation)
|
107 |
|
108 |
+
# π RLHF - Reinforcement Learning with Human Feedback - AGI Holy Grail
|
109 |
π©ΊβοΈ [ROUGE](https://huggingface.co/spaces/evaluate-metric/rouge)
|
110 |
π©ΊβοΈ [BLEU](https://huggingface.co/spaces/evaluate-metric/bleu)
|
111 |
|
112 |
+
# π Hospital Visualizations - AI Pair Programming Around a Theme - Try your own state with code in Prompt.
|
113 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsMinnesota
|
114 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsNewJersey
|
115 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsMentalHealth
|
116 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/VizLib-GraphViz-Folium-MapTopLargeHospitalsinWI
|
117 |
|
118 |
+
# π Graphs and SVG:
|
119 |
π©ΊβοΈ Game Activity Graph: https://huggingface.co/spaces/awacke1/CardGameActivity-GraphViz
|
120 |
π©ΊβοΈ SVG Card Generation: https://huggingface.co/spaces/awacke1/VizLib-SVGWrite-Streamlit
|
121 |
|
122 |
+
# π Clinical Smart on FHIR:
|
123 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/Assessment-By-Organs
|
124 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/SMART-FHIR-Assessment-Test2
|
125 |
π©ΊβοΈ https://huggingface.co/spaces/awacke1/FHIRLib-FHIRKit
|