davanstrien HF staff commited on
Commit
2b23a3d
·
verified ·
1 Parent(s): 9fc3142

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -18,6 +18,24 @@ def generate_text(title, content):
18
  output = tokenizer.decode(model.generate(inputs, max_new_tokens=512)[0]).split(tokenizer.eos_token)[0]
19
  return output
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  demo = gr.Interface(
22
  fn=generate_text,
23
  inputs=[
 
18
  output = tokenizer.decode(model.generate(inputs, max_new_tokens=512)[0]).split(tokenizer.eos_token)[0]
19
  return output
20
 
21
+ examples = [
22
+ [
23
+ "The History of Chess",
24
+ "Chess is a board game of strategic skill for two players, played on a chequered board with 64 squares arranged in an 8×8 grid. The game, with its origins in India around 600 AD, has evolved over centuries to become one of the world's most popular board games. Each player begins with 16 pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. The objective of the game is to 'checkmate' the opponent's king, whereby the king is under immediate attack (in 'check') and there is no way for it to escape."
25
+ ],
26
+ [
27
+ "Climate Change: Causes and Effects",
28
+ "Climate change refers to long-term shifts in temperatures and weather patterns. These shifts may be natural, such as through variations in the solar cycle. But since the 1800s, human activities have been the main driver of climate change, primarily due to burning fossil fuels like coal, oil and gas. Burning fossil fuels generates greenhouse gas emissions that act like a blanket wrapped around the Earth, trapping the sun's heat and raising temperatures. Examples of greenhouse gas emissions that are causing climate change include carbon dioxide and methane."
29
+ ],
30
+ [
31
+ "The Invention of the Internet",
32
+ "The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite (TCP/IP) to link devices worldwide. It is a network of networks that consists of private, public, academic, business, and government networks of local to global scope, linked by a broad array of electronic, wireless, and optical networking technologies. The origins of the Internet date back to research commissioned by the United States government in the 1960s to build robust, fault-tolerant communication with computer networks."
33
+ ]
34
+ ]
35
+
36
+
37
+
38
+
39
  demo = gr.Interface(
40
  fn=generate_text,
41
  inputs=[