awacke1 commited on
Commit
09c2c65
·
1 Parent(s): db1cea5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -25
app.py CHANGED
@@ -5,41 +5,34 @@ import streamlit as st
5
  import streamlit.components.v1 as components
6
  from IPython.display import IFrame
7
 
8
- #quantum imports:
9
- import qiskit
10
- from qiskit import QuantumCircuit, QuantumRegister, execute
11
-
12
  src='' # URL parameter to change the iframe url
13
 
14
  def SetIframeURL(option_selected):
15
- if (option_selected=='QCEngine'):
16
- src='https://oreilly-qc.github.io?p=2-1'
17
- if (option_selected=='Grok'):
18
- src='https://javafxpert.github.io/grok-bloch/'
19
- if (option_selected=='Playground'):
20
- src='https://davidbkemp.github.io/quantum-gate-playground/'
21
- if (option_selected=='Circuit'):
22
- src='https://algassert.com/quirk#circuit={%22cols%22:[[%22H%22],[%22Bloch%22],[%22Measure%22]]}'
 
 
23
 
24
- # Render iframe contents
25
- #st.set_page_config(layout="wide")
26
  width = st.sidebar.slider("Width", 200, 1500, 800, 100)
27
  height = st.sidebar.slider("Height", 200, 1500, 900, 100)
28
  st.components.v1.iframe(src, width, height, scrolling=True)
29
 
30
- # query params exist
31
  try:
32
- options = ['QCEngine', 'Grok', 'Playground', 'Circuit']
33
  query_params = st.experimental_get_query_params()
34
  query_option = query_params['option'][0] #throws an exception when visiting http://host:port
35
  option_selected = st.sidebar.selectbox('Pick option', options, index=options.index(query_option))
36
  if option_selected:
37
  st.experimental_set_query_params(option=option_selected)
38
  SetIframeURL(option_selected)
39
-
40
- # run when query params don't exist. e.g on first launch
41
- except: # catch exception and set query param to predefined value
42
- options = ['QCEngine', 'Grok', 'Playground', 'Circuit']
43
  st.experimental_set_query_params(option=options[1]) # defaults to dog
44
  query_params = st.experimental_get_query_params()
45
  query_option = query_params['option'][0]
@@ -49,10 +42,8 @@ except: # catch exception and set query param to predefined value
49
  SetIframeURL(option_selected)
50
 
51
  def LoadGradioAIModels():
52
- title = "AI Quantum - QGAN and QCEngine"
53
- description = "Using Superposition Advantage from Quantum for QGAN AI."
54
  article = "<p style='text-align: center'></p>"
55
-
56
- examples = [
57
- ["Scientific breakthroughs in treatment of HIV/AIDS may be solved in our lifetime using a procedure called [MASK] modulation which strengthens the immune system to fight the disease."],["A disease called [MASK] disease involves progressive memory loss and has new treatments to improve memory and delay progression of the disease."],["[MASK] refers to the uncontrolled growth of abnormal cells in the body. With chemotherapy and radiation therapy have improvements and replacements that destroy cancer cells before they become resistant to current treatment methods."],["The hereditary disease [MASK] is caused by mucus abnormally thick preventing lungs and pancreas from doing their jobs correctly."],["[MASK] or atherosclerosis is the buildup of cholesterol, fatty cells, and inflammatory deposits in the arteries. Stem cells, mechanical devices, and lowering cholesterol and blood pressure levels are helping prevention."]]
58
 
 
5
  import streamlit.components.v1 as components
6
  from IPython.display import IFrame
7
 
 
 
 
 
8
  src='' # URL parameter to change the iframe url
9
 
10
  def SetIframeURL(option_selected):
11
+ if (option_selected=='Collager'):
12
+ src='https://www.artbreeder.com/beta/collage'
13
+ if (option_selected=='Midjourney'):
14
+ src='https://www.midjourney.com/app/users/779773261440614430/'
15
+ if (option_selected=='DreamStudio'):
16
+ src='https://beta.dreamstudio.ai/dream'
17
+ if (option_selected=='NightCafe'):
18
+ src='https://creator.nightcafe.studio/explore'
19
+ if (option_selected=='RunwayML'):
20
+ src='https://app.runwayml.com/'
21
 
 
 
22
  width = st.sidebar.slider("Width", 200, 1500, 800, 100)
23
  height = st.sidebar.slider("Height", 200, 1500, 900, 100)
24
  st.components.v1.iframe(src, width, height, scrolling=True)
25
 
 
26
  try:
27
+ options = ['Collager', 'Midjourney', 'DreamStudio', 'NightCafe', 'RunwayML']
28
  query_params = st.experimental_get_query_params()
29
  query_option = query_params['option'][0] #throws an exception when visiting http://host:port
30
  option_selected = st.sidebar.selectbox('Pick option', options, index=options.index(query_option))
31
  if option_selected:
32
  st.experimental_set_query_params(option=option_selected)
33
  SetIframeURL(option_selected)
34
+ except:
35
+ options = ['Collager', 'Midjourney', 'DreamStudio', 'NightCafe', 'RunwayML']
 
 
36
  st.experimental_set_query_params(option=options[1]) # defaults to dog
37
  query_params = st.experimental_get_query_params()
38
  query_option = query_params['option'][0]
 
42
  SetIframeURL(option_selected)
43
 
44
  def LoadGradioAIModels():
45
+ title = "Image Generation for Art, Marketing, Ideation, Design, and Use in Business"
46
+ description = "Image Generation for Art, Marketing, Ideation, Design, and Use in Business"
47
  article = "<p style='text-align: center'></p>"
48
+ examples = [[""]]
 
 
49