Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,7 +65,7 @@ def NMRExtractor(Paragraph, max_length):
|
|
| 65 |
|
| 66 |
pipe = pipeline(task="text-generation", model=base_model, tokenizer=tokenizer, max_length=max_length)
|
| 67 |
print('prompt',prompt)
|
| 68 |
-
result = pipe(f"{prompt}",max_length=
|
| 69 |
print('result',result)
|
| 70 |
generation = result[0]['generated_text']
|
| 71 |
print('generation',generation)
|
|
@@ -123,7 +123,7 @@ demo = gr.Interface(
|
|
| 123 |
π‘ We have released the GPU version code of NMRExtractor on github, and the inference speed is an average of 0.5 seconds per item. https://github.com/.../NMRExtractor\n
|
| 124 |
βοΈ1. Enter your text or click to select one from the examples below.\n
|
| 125 |
π2. Set parameters: "max_length": modify according to the length of the text you enter.\n
|
| 126 |
-
π3. After clicking submit, wait
|
| 127 |
""",
|
| 128 |
|
| 129 |
article = 'https://github.com/.../NMRExtractor',
|
|
|
|
| 65 |
|
| 66 |
pipe = pipeline(task="text-generation", model=base_model, tokenizer=tokenizer, max_length=max_length)
|
| 67 |
print('prompt',prompt)
|
| 68 |
+
result = pipe(f"{prompt}",max_length=max_length,truncation=True)
|
| 69 |
print('result',result)
|
| 70 |
generation = result[0]['generated_text']
|
| 71 |
print('generation',generation)
|
|
|
|
| 123 |
π‘ We have released the GPU version code of NMRExtractor on github, and the inference speed is an average of 0.5 seconds per item. https://github.com/.../NMRExtractor\n
|
| 124 |
βοΈ1. Enter your text or click to select one from the examples below.\n
|
| 125 |
π2. Set parameters: "max_length": modify according to the length of the text you enter.\n
|
| 126 |
+
π3. After clicking submit, because the CPU runs very slowly, you need to wait for a long timeβ°.
|
| 127 |
""",
|
| 128 |
|
| 129 |
article = 'https://github.com/.../NMRExtractor',
|