rishiraj commited on
Commit
0c561b9
·
verified ·
1 Parent(s): 28d160a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -2
app.py CHANGED
@@ -1,6 +1,40 @@
1
  from huggingface_hub import InferenceClient
2
  import gradio as gr
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  client = InferenceClient(
5
  "mistralai/Mixtral-8x7B-Instruct-v0.1"
6
  )
@@ -19,13 +53,13 @@ def show_info(section):
19
  return "Select a section to display information."
20
 
21
  # Creating Gradio Interface
22
- with gr.Blocks() as app:
23
  with gr.Row():
24
  with gr.Column():
25
  gr.Markdown("# Hi 👋, I'm Rishiraj Acharya (ঋষিরাজ আচার্য্য)")
26
  gr.Markdown("## Google Developer Expert in ML ✨ | Hugging Face Fellow 🤗 | GSoC '22 at TensorFlow 👨🏻‍🔬 | TFUG Kolkata Organizer 🎙️ | Kaggle Master 🧠 | Dynopii ML Engineer 👨🏻‍💻")
27
  gr.Markdown("### I work with natural language understanding, machine translation, named entity recognition, question answering, topic segmentation, and automatic speech recognition. My work typically relies on very large quantities of data and innovative methods in deep learning to tackle user challenges around the world — in languages from around the world. My areas of work include Natural Language Engineering, Language Modeling, Text-to-Speech Software Engineering, Speech Frameworks Engineering, Data Science, and Research.")
28
- gr.HTML(value='<h3 align="left">Connect with me:</h3> <p align="center"> <a href="https://twitter.com/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg" alt="rishirajacharya" height="30" width="40" /></a> <a href="https://linkedin.com/in/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/linked-in-alt.svg" alt="rishirajacharya" height="30" width="40" /></a> <a href="https://kaggle.com/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/kaggle.svg" alt="rishirajacharya" height="30" width="40" /></a> <a href="https://fb.com/acharyarishiraj" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/facebook.svg" alt="acharyarishiraj" height="30" width="40" /></a> <a href="https://instagram.com/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="rishirajacharya" height="30" width="40" /></a> </p>')
29
  with gr.Column():
30
  gr.Image("profile.png")
31
 
@@ -125,6 +159,7 @@ llm = gr.ChatInterface(
125
  title="Hi 👋, I'm Rishiraj Acharya (ঋষিরাজ আচার্য্য)",
126
  examples=examples,
127
  concurrency_limit=20,
 
128
  )
129
 
130
  demo = gr.TabbedInterface([app, llm], ["About", "Chat"])
 
1
  from huggingface_hub import InferenceClient
2
  import gradio as gr
3
 
4
+ js = """
5
+ function createGradioAnimation() {
6
+ var container = document.createElement('div');
7
+ container.id = 'gradio-animation';
8
+ container.style.fontSize = '2em';
9
+ container.style.fontWeight = 'bold';
10
+ container.style.textAlign = 'center';
11
+ container.style.marginBottom = '20px';
12
+
13
+ var text = 'Hi 👋, I'm Rishiraj Acharya (ঋষিরাজ আচার্য্য)';
14
+ for (var i = 0; i < text.length; i++) {
15
+ (function(i){
16
+ setTimeout(function(){
17
+ var letter = document.createElement('span');
18
+ letter.style.opacity = '0';
19
+ letter.style.transition = 'opacity 0.5s';
20
+ letter.innerText = text[i];
21
+
22
+ container.appendChild(letter);
23
+
24
+ setTimeout(function() {
25
+ letter.style.opacity = '1';
26
+ }, 50);
27
+ }, i * 250);
28
+ })(i);
29
+ }
30
+
31
+ var gradioContainer = document.querySelector('.gradio-container');
32
+ gradioContainer.insertBefore(container, gradioContainer.firstChild);
33
+
34
+ return 'Animation created';
35
+ }
36
+ """
37
+
38
  client = InferenceClient(
39
  "mistralai/Mixtral-8x7B-Instruct-v0.1"
40
  )
 
53
  return "Select a section to display information."
54
 
55
  # Creating Gradio Interface
56
+ with gr.Blocks(js=js) as app:
57
  with gr.Row():
58
  with gr.Column():
59
  gr.Markdown("# Hi 👋, I'm Rishiraj Acharya (ঋষিরাজ আচার্য্য)")
60
  gr.Markdown("## Google Developer Expert in ML ✨ | Hugging Face Fellow 🤗 | GSoC '22 at TensorFlow 👨🏻‍🔬 | TFUG Kolkata Organizer 🎙️ | Kaggle Master 🧠 | Dynopii ML Engineer 👨🏻‍💻")
61
  gr.Markdown("### I work with natural language understanding, machine translation, named entity recognition, question answering, topic segmentation, and automatic speech recognition. My work typically relies on very large quantities of data and innovative methods in deep learning to tackle user challenges around the world — in languages from around the world. My areas of work include Natural Language Engineering, Language Modeling, Text-to-Speech Software Engineering, Speech Frameworks Engineering, Data Science, and Research.")
62
+ gr.HTML(value='<a href="https://twitter.com/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg" alt="rishirajacharya" height="30" width="40" /></a><a href="https://linkedin.com/in/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/linked-in-alt.svg" alt="rishirajacharya" height="30" width="40" /></a><a href="https://instagram.com/rishirajacharya" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="rishirajacharya" height="30" width="40" /></a>')
63
  with gr.Column():
64
  gr.Image("profile.png")
65
 
 
159
  title="Hi 👋, I'm Rishiraj Acharya (ঋষিরাজ আচার্য্য)",
160
  examples=examples,
161
  concurrency_limit=20,
162
+ js=js,
163
  )
164
 
165
  demo = gr.TabbedInterface([app, llm], ["About", "Chat"])