jer233 commited on
Commit
a3079c6
·
verified ·
1 Parent(s): 9ee3bcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -4
app.py CHANGED
@@ -28,18 +28,20 @@ def run_test(input_text):
28
 
29
 
30
  css = """
31
- #header { text-align: center; font-size: 3em; margin-bottom: 20px; }
32
- #output-text { font-weight: bold; font-size: 1.2em; }
33
  .links {
34
  display: flex;
35
  justify-content: flex-end;
36
  gap: 10px;
37
  margin-right: 10px;
38
  align-items: center;
 
 
39
  }
40
  .separator {
41
  margin: 0 5px;
42
- color: black;
43
  }
44
 
45
  /* Adjusting layout for Input Text and Inference Result */
@@ -51,16 +53,30 @@ css = """
51
  .input-text {
52
  flex: 3; /* 4 parts of the row */
53
  margin-right: 1px;
 
 
 
54
  }
55
 
56
  .output-text {
57
  flex: 1; /* 1 part of the row */
 
 
 
58
  }
59
 
60
  /* Set button widths to match the Select Model width */
61
  .button {
62
  width: 250px; /* Same as the select box width */
63
  height: 100px; /* Button height */
 
 
 
 
 
 
 
 
64
  }
65
 
66
  /* Set height for the Select Model dropdown */
@@ -82,6 +98,17 @@ css = """
82
  max-height: 200px; /* Limit the height of the content */
83
  overflow-y: auto; /* Add a scrollbar if content overflows */
84
  }
 
 
 
 
 
 
 
 
 
 
 
85
  """
86
 
87
  # Gradio App
@@ -100,12 +127,17 @@ with gr.Blocks(css=css) as app:
100
  </div>
101
  """
102
  )
 
 
 
 
103
  with gr.Row():
104
  input_text = gr.Textbox(
105
  label="Input Text",
106
  placeholder="Enter Text Here",
107
  lines=8,
108
  elem_classes=["input-text"], # Applying the CSS class
 
109
  )
110
  output = gr.Textbox(
111
  label="Inference Result",
@@ -157,4 +189,3 @@ with gr.Blocks(css=css) as app:
157
  )
158
 
159
  app.launch()
160
-
 
28
 
29
 
30
  css = """
31
+ #header { text-align: center; font-size: 3em; margin-bottom: 20px; color: #3b5998; font-weight: bold;}
32
+ #output-text { font-weight: bold; font-size: 1.2em; border-radius: 10px; padding: 10px; background-color: #f4f4f4;}
33
  .links {
34
  display: flex;
35
  justify-content: flex-end;
36
  gap: 10px;
37
  margin-right: 10px;
38
  align-items: center;
39
+ font-size: 0.9em;
40
+ color: #5c6bc0;
41
  }
42
  .separator {
43
  margin: 0 5px;
44
+ color: #000;
45
  }
46
 
47
  /* Adjusting layout for Input Text and Inference Result */
 
53
  .input-text {
54
  flex: 3; /* 4 parts of the row */
55
  margin-right: 1px;
56
+ border-radius: 8px;
57
+ padding: 12px;
58
+ border: 2px soild #d1d1d1;
59
  }
60
 
61
  .output-text {
62
  flex: 1; /* 1 part of the row */
63
+ border-radius: 8px;
64
+ padding: 12px;
65
+ border: 2px soild #d1d1d1;
66
  }
67
 
68
  /* Set button widths to match the Select Model width */
69
  .button {
70
  width: 250px; /* Same as the select box width */
71
  height: 100px; /* Button height */
72
+ background-color: #3b5998;
73
+ color: white;
74
+ font-weight: bold;
75
+ border-radius: 8px;
76
+ }
77
+
78
+ .button:hover {
79
+ background-color: #2d4373;
80
  }
81
 
82
  /* Set height for the Select Model dropdown */
 
98
  max-height: 200px; /* Limit the height of the content */
99
  overflow-y: auto; /* Add a scrollbar if content overflows */
100
  }
101
+
102
+ .demo-banner {
103
+ background-color: #f3f4f6;
104
+ padding: 20px;
105
+ border-radius: 10px;
106
+ font-size: 1.1em;
107
+ font-weight: bold;
108
+ text-align: center;
109
+ margin-bottom: 20px;
110
+ color: #ff5722;
111
+ }
112
  """
113
 
114
  # Gradio App
 
127
  </div>
128
  """
129
  )
130
+
131
+ with gr.row():
132
+ gr.HTML('<div class="demo-banner">This is a demo. For the full version, please refer to the <a href="https://github.com/xLearn-AU/R-Detect" target="_blank">GitHub</a> or the <a href="https://openreview.net/forum?id=z9j7wctoGV" target="_blank">Paper</a>.</div>')
133
+
134
  with gr.Row():
135
  input_text = gr.Textbox(
136
  label="Input Text",
137
  placeholder="Enter Text Here",
138
  lines=8,
139
  elem_classes=["input-text"], # Applying the CSS class
140
+ value="Archetypes represent universal patterns that define certain events, objects, or people. In literature, they reflect common themes and ideas that resonate across cultures, helping people interpret and relate to stories. However, archetypes are not limited to literature; they also exist in everyday life and play a vital role in shaping how we perceive the world. Specifically, archetypes of people help us understand their character, actions, and motivations. In real life, we can identify certain types of individuals who share common traits shaped by both personal inclinations and their environments. For instance, a modern corporate leader like Elon Musk exemplifies the archetype of a hero or creator. His vision and courage to innovate make him a prime example of this archetype, as others often view him as someone driven by a desire to transform the world. These traits influence not only how he is perceived but also his actions and motivations. Recognizing archetypes in daily life allows for a deeper understanding of people and events. By identifying these characteristics, I can better grasp someone’s motivations and role, making their behavior more predictable. While real-life individuals may exhibit a blend of archetypal traits, the concept still helps me interpret their actions and personalities, which in turn informs how I interact with them. (This is a example from Chatgpt)"
141
  )
142
  output = gr.Textbox(
143
  label="Inference Result",
 
189
  )
190
 
191
  app.launch()