amazon-science / polygon-transformer

Apache License 2.0
128 stars 8 forks source link

Demo app problem #22

Closed vvuonghn closed 4 months ago

vvuonghn commented 8 months ago

Hi I meet problem with app.py when I try to run gradio demo. Can not run the inference

image

the log shows

2024-01-22 23:48:37 | INFO | bert.file_utils | PyTorch version 1.13.1+cu117 available.
2024-01-22 23:48:40 | INFO | tasks.base_task | source dictionary: 4100 types
2024-01-22 23:48:40 | INFO | tasks.base_task | target dictionary: 4100 types
/home/vuonghn/Applications/anaconda3/envs/polyformer/lib/python3.7/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
2024-01-22 23:48:42 | INFO | bert.configuration_utils | loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-config.json from cache at /home/vuonghn/.cache/torch/transformers/4dad0251492946e18ac39290fcfe91b89d370fee250efe9521476438fe8ca185.7156163d5fdc189c3016baca0775ffce230789d7fa2a42ef516483e4ca884517
2024-01-22 23:48:42 | INFO | bert.configuration_utils | Model config BertConfig {
  "architectures": [
    "BertForMaskedLM"
  ],
  "attention_probs_dropout_prob": 0.1,
  "gradient_checkpointing": false,
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.1,
  "hidden_size": 768,
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "layer_norm_eps": 1e-12,
  "max_position_embeddings": 512,
  "model_type": "bert",
  "num_attention_heads": 12,
  "num_hidden_layers": 12,
  "pad_token_id": 0,
  "type_vocab_size": 2,
  "vocab_size": 30522
}

2024-01-22 23:48:42 | INFO | bert.modeling_utils | loading weights file https://cdn.huggingface.co/bert-base-uncased-pytorch_model.bin from cache at /home/vuonghn/.cache/torch/transformers/f2ee78bdd635b758cc0a12352586868bef80e47401abe4c4fcc3832421e7338b.36ca03ab34a1a5d5fa7bc3d03d55c4fa650fed07220e2eeebc06ce58d0e9a157
2024-01-22 23:48:43 | INFO | bert.modeling_utils | All model checkpoint weights were used when initializing BertModel.

2024-01-22 23:48:43 | INFO | bert.modeling_utils | All the weights of BertModel were initialized from the model checkpoint at bert-base-uncased.
If your task is similar to the task the model of the ckeckpoint was trained on, you can already use BertModel for predictions without further training.
2024-01-22 23:48:45 | INFO | bert.tokenization_utils_base | loading file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt from cache at /home/vuonghn/.cache/torch/transformers/26bc1ad6c0ac742e9b52263248f6d0f00068293b33709fae12320c0e35ccfbbb.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084
/home/vuonghn/Applications/anaconda3/envs/polyformer/lib/python3.7/site-packages/torchvision/transforms/transforms.py:330: UserWarning: Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
  "Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
/home/vuonghn/Applications/anaconda3/envs/polyformer/lib/python3.7/site-packages/gradio/inputs.py:260: UserWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components
  "Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components",
/home/vuonghn/Applications/anaconda3/envs/polyformer/lib/python3.7/site-packages/gradio/inputs.py:270: UserWarning: `optional` parameter is deprecated, and it has no effect
  optional=optional,
/home/vuonghn/Applications/anaconda3/envs/polyformer/lib/python3.7/site-packages/gradio/outputs.py:44: UserWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components
  "Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components",
app.py:45: UserWarning: `allow_screenshot` parameter is deprecated, and it has no effect
  allow_flagging=False, allow_screenshot=False, cache_examples=False)
/home/vuonghn/Applications/anaconda3/envs/polyformer/lib/python3.7/site-packages/gradio/interface.py:326: UserWarning: The `allow_flagging` parameter in `Interface` nowtakes a string value ('auto', 'manual', or 'never'), not a boolean. Setting parameter to: 'never'.
  "The `allow_flagging` parameter in `Interface` now"
Running on local URL:  http://127.0.0.1:7860
Running on public URL: https://16ffb692b2866b7540.gradio.live

This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)
joellliu commented 8 months ago

Not sure what happened. It does not show any error message here.