gonzalocordova commited on
Commit
05ebd8a
·
1 Parent(s): 9b41375

feat: adding examples in the UI

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -59,4 +59,11 @@ def predict_fn(text):
59
  print(top3)
60
  return {id : round(top3[id], 2) for id in top3}
61
 
62
- gr.Interface(predict_fn, gr.inputs.Textbox(label="Input Text"), outputs="label").launch()
 
 
 
 
 
 
 
 
59
  print(top3)
60
  return {id : round(top3[id], 2) for id in top3}
61
 
62
+ examples = [
63
+ "Biologists have sought to study and classify the various forms of life, from prokaryotic organisms such as archaea and bacteria to eukaryotic organisms such as protists, fungi, plants, and animals.",
64
+ "Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation via the off-side rule. Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming.",
65
+ "One notable example of Latino involvement in far-right racist politics can be found in the early 1950s, also in the Dallas area. Pete Garcia was working with the South Dallas Adjustment League to prevent Black Texans from moving into the community. Mr. Garcia, a 26-year-old machinist, placed “For Whites Only” signs in the yards of white neighborhoods. Along with other members of the S.D.A.L., he menaced a white man who threatened to sell a home in a white neighborhood to a Black family, and he was indicted on a charge of bombing the home of another Black family who had dared to purchase a home in a white neighborhood.",
66
+ "Cosmology is the study of the vast universe, which includes galaxies, nebulae, black holes, and supernovae, all held together by the force of gravity, as planets and stars continue to form and evolve."
67
+ ]
68
+
69
+ gr.Interface(predict_fn, gr.inputs.Textbox(label="Input Text"), outputs="label", examples=examples).launch()