Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from wtpsplit import SaT
|
| 3 |
|
|
@@ -5,7 +6,9 @@ from wtpsplit import SaT
|
|
| 5 |
# We use 'sat-3l-sm' as it's recommended for general sentence segmentation tasks
|
| 6 |
# and offers a good balance between speed and performance
|
| 7 |
sat = SaT("sat-3l-sm")
|
|
|
|
| 8 |
|
|
|
|
| 9 |
def segment_text(input_text):
|
| 10 |
# Use the SaT model to split the input text into sentences
|
| 11 |
sentences = sat.split(input_text)
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
from wtpsplit import SaT
|
| 4 |
|
|
|
|
| 6 |
# We use 'sat-3l-sm' as it's recommended for general sentence segmentation tasks
|
| 7 |
# and offers a good balance between speed and performance
|
| 8 |
sat = SaT("sat-3l-sm")
|
| 9 |
+
sat.half().to("cuda")
|
| 10 |
|
| 11 |
+
@spaces.GPU
|
| 12 |
def segment_text(input_text):
|
| 13 |
# Use the SaT model to split the input text into sentences
|
| 14 |
sentences = sat.split(input_text)
|