Spaces:
Running
Running
aliasgerovs
commited on
Commit
•
9bf5d9f
1
Parent(s):
edc836f
Segmented Higlighter updated
Browse files
app.py
CHANGED
@@ -20,9 +20,9 @@ with open("config.yaml", "r") as file:
|
|
20 |
model_list = params["MC_OUTPUT_LABELS"]
|
21 |
|
22 |
|
23 |
-
analyze_and_highlight_bc = partial(segmented_higlighter, model_type="bc")
|
24 |
analyze_and_highlight_quillbot = partial(
|
25 |
-
segmented_higlighter, model_type="quillbot"
|
26 |
)
|
27 |
|
28 |
|
|
|
20 |
model_list = params["MC_OUTPUT_LABELS"]
|
21 |
|
22 |
|
23 |
+
analyze_and_highlight_bc = partial(segmented_higlighter, bias_buster_selected, model_type="bc")
|
24 |
analyze_and_highlight_quillbot = partial(
|
25 |
+
segmented_higlighter, bias_buster_selected, model_type="quillbot"
|
26 |
)
|
27 |
|
28 |
|
nohup.out
CHANGED
@@ -593,3 +593,132 @@ Traceback (most recent call last):
|
|
593 |
File "/home/aliasgarov/copyright_checker/predictors.py", line 39, in <module>
|
594 |
).to(device)
|
595 |
NameError: name 'device' is not defined
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
File "/home/aliasgarov/copyright_checker/predictors.py", line 39, in <module>
|
594 |
).to(device)
|
595 |
NameError: name 'device' is not defined
|
596 |
+
/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
|
597 |
+
warnings.warn(
|
598 |
+
/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
|
599 |
+
warnings.warn(
|
600 |
+
2024-05-24 14:39:54.016317: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
|
601 |
+
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
|
602 |
+
[nltk_data] Downloading package punkt to /root/nltk_data...
|
603 |
+
[nltk_data] Package punkt is already up-to-date!
|
604 |
+
[nltk_data] Downloading package stopwords to /root/nltk_data...
|
605 |
+
[nltk_data] Package stopwords is already up-to-date!
|
606 |
+
/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
|
607 |
+
warnings.warn(
|
608 |
+
The BetterTransformer implementation does not support padding during training, as the fused kernels do not support attention masks. Beware that passing padded batched data during training may result in unexpected outputs. Please refer to https://huggingface.co/docs/optimum/bettertransformer/overview for more details.
|
609 |
+
The BetterTransformer implementation does not support padding during training, as the fused kernels do not support attention masks. Beware that passing padded batched data during training may result in unexpected outputs. Please refer to https://huggingface.co/docs/optimum/bettertransformer/overview for more details.
|
610 |
+
The BetterTransformer implementation does not support padding during training, as the fused kernels do not support attention masks. Beware that passing padded batched data during training may result in unexpected outputs. Please refer to https://huggingface.co/docs/optimum/bettertransformer/overview for more details.
|
611 |
+
The BetterTransformer implementation does not support padding during training, as the fused kernels do not support attention masks. Beware that passing padded batched data during training may result in unexpected outputs. Please refer to https://huggingface.co/docs/optimum/bettertransformer/overview for more details.
|
612 |
+
The BetterTransformer implementation does not support padding during training, as the fused kernels do not support attention masks. Beware that passing padded batched data during training may result in unexpected outputs. Please refer to https://huggingface.co/docs/optimum/bettertransformer/overview for more details.
|
613 |
+
Some weights of the model checkpoint at textattack/roberta-base-CoLA were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']
|
614 |
+
- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
|
615 |
+
- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
|
616 |
+
The BetterTransformer implementation does not support padding during training, as the fused kernels do not support attention masks. Beware that passing padded batched data during training may result in unexpected outputs. Please refer to https://huggingface.co/docs/optimum/bettertransformer/overview for more details.
|
617 |
+
Framework not specified. Using pt to export the model.
|
618 |
+
Some weights of the model checkpoint at textattack/roberta-base-CoLA were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']
|
619 |
+
- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
|
620 |
+
- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
|
621 |
+
Using the export variant default. Available variants are:
|
622 |
+
- default: The default ONNX variant.
|
623 |
+
|
624 |
+
***** Exporting submodel 1/1: RobertaForSequenceClassification *****
|
625 |
+
Using framework PyTorch: 2.3.0+cu121
|
626 |
+
Overriding 1 configuration item(s)
|
627 |
+
- use_cache -> False
|
628 |
+
Framework not specified. Using pt to export the model.
|
629 |
+
Using the export variant default. Available variants are:
|
630 |
+
- default: The default ONNX variant.
|
631 |
+
Some non-default generation parameters are set in the model config. These should go into a GenerationConfig file (https://huggingface.co/docs/transformers/generation_strategies#save-a-custom-decoding-strategy-with-your-model) instead. This warning will be raised to an exception in v4.41.
|
632 |
+
Non-default generation parameters: {'max_length': 512, 'min_length': 8, 'num_beams': 2, 'no_repeat_ngram_size': 4}
|
633 |
+
/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
|
634 |
+
warnings.warn(
|
635 |
+
|
636 |
+
***** Exporting submodel 1/3: T5Stack *****
|
637 |
+
Using framework PyTorch: 2.3.0+cu121
|
638 |
+
Overriding 1 configuration item(s)
|
639 |
+
- use_cache -> False
|
640 |
+
|
641 |
+
***** Exporting submodel 2/3: T5ForConditionalGeneration *****
|
642 |
+
Using framework PyTorch: 2.3.0+cu121
|
643 |
+
Overriding 1 configuration item(s)
|
644 |
+
- use_cache -> True
|
645 |
+
/usr/local/lib/python3.9/dist-packages/transformers/modeling_utils.py:1017: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
|
646 |
+
if causal_mask.shape[1] < attention_mask.shape[1]:
|
647 |
+
|
648 |
+
***** Exporting submodel 3/3: T5ForConditionalGeneration *****
|
649 |
+
Using framework PyTorch: 2.3.0+cu121
|
650 |
+
Overriding 1 configuration item(s)
|
651 |
+
- use_cache -> True
|
652 |
+
/usr/local/lib/python3.9/dist-packages/transformers/models/t5/modeling_t5.py:503: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
|
653 |
+
elif past_key_value.shape[2] != key_value_states.shape[1]:
|
654 |
+
In-place op on output of tensor.shape. See https://pytorch.org/docs/master/onnx.html#avoid-inplace-operations-when-using-tensor-shape-in-tracing-mode
|
655 |
+
In-place op on output of tensor.shape. See https://pytorch.org/docs/master/onnx.html#avoid-inplace-operations-when-using-tensor-shape-in-tracing-mode
|
656 |
+
Some non-default generation parameters are set in the model config. These should go into a GenerationConfig file (https://huggingface.co/docs/transformers/generation_strategies#save-a-custom-decoding-strategy-with-your-model) instead. This warning will be raised to an exception in v4.41.
|
657 |
+
Non-default generation parameters: {'max_length': 512, 'min_length': 8, 'num_beams': 2, 'no_repeat_ngram_size': 4}
|
658 |
+
[nltk_data] Downloading package cmudict to /root/nltk_data...
|
659 |
+
[nltk_data] Package cmudict is already up-to-date!
|
660 |
+
[nltk_data] Downloading package punkt to /root/nltk_data...
|
661 |
+
[nltk_data] Package punkt is already up-to-date!
|
662 |
+
[nltk_data] Downloading package stopwords to /root/nltk_data...
|
663 |
+
[nltk_data] Package stopwords is already up-to-date!
|
664 |
+
[nltk_data] Downloading package wordnet to /root/nltk_data...
|
665 |
+
[nltk_data] Package wordnet is already up-to-date!
|
666 |
+
Collecting en-core-web-sm==3.7.1
|
667 |
+
Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl (12.8 MB)
|
668 |
+
Requirement already satisfied: spacy<3.8.0,>=3.7.2 in /usr/local/lib/python3.9/dist-packages (from en-core-web-sm==3.7.1) (3.7.2)
|
669 |
+
Requirement already satisfied: typer<0.10.0,>=0.3.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (0.9.4)
|
670 |
+
Requirement already satisfied: thinc<8.3.0,>=8.1.8 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (8.2.3)
|
671 |
+
Requirement already satisfied: pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.7.1)
|
672 |
+
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (24.0)
|
673 |
+
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (3.0.9)
|
674 |
+
Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.11 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (3.0.12)
|
675 |
+
Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.0.10)
|
676 |
+
Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.4.8)
|
677 |
+
Requirement already satisfied: numpy>=1.19.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (1.26.4)
|
678 |
+
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.0.8)
|
679 |
+
Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (3.1.4)
|
680 |
+
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/lib/python3/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.25.1)
|
681 |
+
Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (4.66.4)
|
682 |
+
Requirement already satisfied: wasabi<1.2.0,>=0.9.1 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (1.1.2)
|
683 |
+
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (52.0.0)
|
684 |
+
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (1.0.10)
|
685 |
+
Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (3.4.0)
|
686 |
+
Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (1.0.5)
|
687 |
+
Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (6.4.0)
|
688 |
+
Requirement already satisfied: weasel<0.4.0,>=0.1.0 in /usr/local/lib/python3.9/dist-packages (from spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (0.3.4)
|
689 |
+
Requirement already satisfied: language-data>=1.2 in /usr/local/lib/python3.9/dist-packages (from langcodes<4.0.0,>=3.2.0->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (1.2.0)
|
690 |
+
Requirement already satisfied: marisa-trie>=0.7.7 in /usr/local/lib/python3.9/dist-packages (from language-data>=1.2->langcodes<4.0.0,>=3.2.0->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (1.1.1)
|
691 |
+
Requirement already satisfied: pydantic-core==2.18.2 in /usr/local/lib/python3.9/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.18.2)
|
692 |
+
Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.9/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (0.6.0)
|
693 |
+
Requirement already satisfied: typing-extensions>=4.6.1 in /usr/local/lib/python3.9/dist-packages (from pydantic!=1.8,!=1.8.1,<3.0.0,>=1.7.4->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (4.11.0)
|
694 |
+
Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.9/dist-packages (from thinc<8.3.0,>=8.1.8->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (0.7.11)
|
695 |
+
Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.9/dist-packages (from thinc<8.3.0,>=8.1.8->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (0.1.4)
|
696 |
+
Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.9/dist-packages (from typer<0.10.0,>=0.3.0->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (8.1.7)
|
697 |
+
Requirement already satisfied: cloudpathlib<0.17.0,>=0.7.0 in /usr/local/lib/python3.9/dist-packages (from weasel<0.4.0,>=0.1.0->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (0.16.0)
|
698 |
+
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.9/dist-packages (from jinja2->spacy<3.8.0,>=3.7.2->en-core-web-sm==3.7.1) (2.1.5)
|
699 |
+
[38;5;2m✔ Download and installation successful[0m
|
700 |
+
You can now load the package via spacy.load('en_core_web_sm')
|
701 |
+
/usr/local/lib/python3.9/dist-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
|
702 |
+
warnings.warn(
|
703 |
+
Token indices sequence length is longer than the specified maximum sequence length for this model (532 > 512). Running this sequence through the model will result in indexing errors
|
704 |
+
Traceback (most recent call last):
|
705 |
+
File "/usr/local/lib/python3.9/dist-packages/gradio/queueing.py", line 527, in process_events
|
706 |
+
response = await route_utils.call_process_api(
|
707 |
+
File "/usr/local/lib/python3.9/dist-packages/gradio/route_utils.py", line 261, in call_process_api
|
708 |
+
output = await app.get_blocks().process_api(
|
709 |
+
File "/usr/local/lib/python3.9/dist-packages/gradio/blocks.py", line 1786, in process_api
|
710 |
+
result = await self.call_function(
|
711 |
+
File "/usr/local/lib/python3.9/dist-packages/gradio/blocks.py", line 1338, in call_function
|
712 |
+
prediction = await anyio.to_thread.run_sync(
|
713 |
+
File "/usr/local/lib/python3.9/dist-packages/anyio/to_thread.py", line 56, in run_sync
|
714 |
+
return await get_async_backend().run_sync_in_worker_thread(
|
715 |
+
File "/usr/local/lib/python3.9/dist-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
|
716 |
+
return await future
|
717 |
+
File "/usr/local/lib/python3.9/dist-packages/anyio/_backends/_asyncio.py", line 851, in run
|
718 |
+
result = context.run(func, *args)
|
719 |
+
File "/usr/local/lib/python3.9/dist-packages/gradio/utils.py", line 759, in wrapper
|
720 |
+
response = f(*args, **kwargs)
|
721 |
+
File "/home/aliasgarov/copyright_checker/highlighter.py", line 76, in segmented_higlighter
|
722 |
+
chunk = analyze_and_highlight(segment, model_type)
|
723 |
+
TypeError: analyze_and_highlight() missing 1 required positional argument: 'model_type'
|
724 |
+
WARNING: Invalid HTTP request received.
|