max-long commited on
Commit
32d4891
·
verified ·
1 Parent(s): 85c3256

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -48,8 +48,8 @@ with gr.Blocks(title="Textile Machinery NER Demo") as demo:
48
  """
49
  )
50
 
51
- gr.Code(
52
- '''
53
  from gliner import GLiNER
54
  model = GLiNER.from_pretrained("max-long/textile_machines_3_oct")
55
  text = "Your sample text here."
@@ -57,15 +57,15 @@ labels = ["textile machinery"]
57
  entities = model.predict_entities(text, labels)
58
  for entity in entities:
59
  print(entity["text"], "=>", entity["label"])
60
- ''',
61
- language="python",
62
- )
63
- gr.Code(
64
- """
65
  Textile Machine 1 => textile machinery
66
  Textile Machine 2 => textile machinery
67
- """
68
- )
69
 
70
  # Display a random example
71
  input_text = gr.Textbox(
 
48
  """
49
  )
50
 
51
+ gr.Code(
52
+ '''
53
  from gliner import GLiNER
54
  model = GLiNER.from_pretrained("max-long/textile_machines_3_oct")
55
  text = "Your sample text here."
 
57
  entities = model.predict_entities(text, labels)
58
  for entity in entities:
59
  print(entity["text"], "=>", entity["label"])
60
+ ''',
61
+ language="python",
62
+ )
63
+ gr.Code(
64
+ """
65
  Textile Machine 1 => textile machinery
66
  Textile Machine 2 => textile machinery
67
+ """
68
+ )
69
 
70
  # Display a random example
71
  input_text = gr.Textbox(