Spaces:
Sleeping
Sleeping
Updating the defaults
Browse files- steering_gradio.py +4 -46
steering_gradio.py
CHANGED
@@ -103,51 +103,9 @@ def launch_app():
|
|
103 |
steering_vec = gr.State(None)
|
104 |
layer = gr.State(None)
|
105 |
|
106 |
-
away_default = [
|
107 |
-
|
108 |
-
|
109 |
-
"There are over 7,500 known cultivars of apples.",
|
110 |
-
"Apples are members of the rose family, Rosaceae.",
|
111 |
-
# "The science of apple cultivation is called pomology.",
|
112 |
-
# "Apple trees typically take 4-5 years to produce their first fruit.",
|
113 |
-
# "The phrase 'An apple a day keeps the doctor away' originated in Wales in the 19th century.",
|
114 |
-
# "Apples are rich in antioxidants, flavonoids, and dietary fiber.",
|
115 |
-
# "The most popular apple variety in the United States is the Gala apple.",
|
116 |
-
# "Apple seeds contain a compound called amygdalin, which can release cyanide when digested.",
|
117 |
-
# "The apple is the official state fruit of New York.",
|
118 |
-
# "Apples can be eaten raw, cooked, or pressed for juice.",
|
119 |
-
# "The largest apple ever picked weighed 4 pounds 1 ounce.",
|
120 |
-
# "Apples float in water because 25 percent of their volume is air.",
|
121 |
-
# "The apple blossom is the state flower of Michigan.",
|
122 |
-
# "China is the world's largest producer of apples.",
|
123 |
-
# "The average apple tree can produce up to 840 pounds of apples per year.",
|
124 |
-
# "Apples ripen six to ten times faster at room temperature than if they are refrigerated.",
|
125 |
-
# "The first apple trees in North America were planted by pilgrims in Massachusetts Bay Colony.",
|
126 |
-
# "Apples are harvested by hand in orchards."
|
127 |
-
]
|
128 |
-
|
129 |
-
towards_default = [
|
130 |
-
"The United States of America is the world's third-largest country by total area.",
|
131 |
-
"America declared its independence from Great Britain on July 4, 1776.",
|
132 |
-
"The U.S. Constitution, written in 1787, is the oldest written national constitution still in use.",
|
133 |
-
"The United States has 50 states and one federal district, Washington D.C.",
|
134 |
-
# "America's national motto is 'In God We Trust,' adopted in 1956.",
|
135 |
-
# "The bald eagle is the national bird and symbol of the United States.",
|
136 |
-
# "The Statue of Liberty, a gift from France, stands in New York Harbor as a symbol of freedom.",
|
137 |
-
# "American culture has had a significant influence on global entertainment and technology.",
|
138 |
-
# "The United States is home to many diverse ecosystems, from deserts to tropical rainforests.",
|
139 |
-
# "America is often referred to as a 'melting pot' due to its diverse immigrant population.",
|
140 |
-
# "The U.S. has the world's largest economy by nominal GDP.",
|
141 |
-
# "American football, derived from rugby, is the most popular sport in the United States.",
|
142 |
-
# "The Grand Canyon, located in Arizona, is one of America's most famous natural landmarks.",
|
143 |
-
# "The U.S. sent the first humans to walk on the moon in 1969.",
|
144 |
-
# "America's system of government is a federal republic with a presidential system.",
|
145 |
-
# "The American flag, known as the Stars and Stripes, has 13 stripes and 50 stars.",
|
146 |
-
# "English is the de facto national language, but the U.S. has no official language at the federal level.",
|
147 |
-
# "The United States is home to many world-renowned universities, including Harvard and MIT.",
|
148 |
-
# "America's national anthem, 'The Star-Spangled Banner,' was written in 1814.",
|
149 |
-
# "The U.S. Interstate Highway System, started in 1956, is one of the largest public works projects in history."
|
150 |
-
]
|
151 |
|
152 |
with gr.Row():
|
153 |
towards = gr.Textbox(label="Towards (comma-separated)", value= ", ".join(sentence.replace(",", "") for sentence in towards_default))
|
@@ -177,4 +135,4 @@ if __name__ == "__main__":
|
|
177 |
|
178 |
# clean up
|
179 |
# nicer baseline vs intervention
|
180 |
-
# auto clear after messgae
|
|
|
103 |
steering_vec = gr.State(None)
|
104 |
layer = gr.State(None)
|
105 |
|
106 |
+
away_default = ['hate','i hate this', 'hating the', 'hater', 'hating', 'hated in']
|
107 |
+
|
108 |
+
towards_default = ['love','i love this', 'loving the', 'lover', 'loving', 'loved in']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
with gr.Row():
|
111 |
towards = gr.Textbox(label="Towards (comma-separated)", value= ", ".join(sentence.replace(",", "") for sentence in towards_default))
|
|
|
135 |
|
136 |
# clean up
|
137 |
# nicer baseline vs intervention
|
138 |
+
# auto clear after messgae
|