Uname : Linux premium36.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Soft : LiteSpeed
Ip : 198.54.115.237
Port : 443
~
/
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
integrations
/
__pycache__
[ HOME ]
Exec
Submit
File Name : huggingface_hub.cpython-312.pyc
� w�/ih: � �� � d dl Z d dlmZ d dlZd dlmZ d dlmZ d dlm Z m Z d dlmZm Z d dlmZ d dlmZ d d lmZmZ d d lmZ er d dlmZmZmZ d dlZ G d � de � Zd� Zd� Zy# e$ r ed� �w xY w)� N��wraps)�record_token_usage)�set_data_normalized)�OP�SPANDATA)�DidNotEnable�Integration)�should_send_default_pii)�set_span_errored)�capture_internal_exceptions�event_from_exception)� TYPE_CHECKING)�Any�Callable�IterablezHuggingface not installedc �2 � e Zd ZdZde� �Zdd�Zed� � Zy)�HuggingfaceHubIntegration�huggingface_hubzauto.ai.c � � || _ y �N)�include_prompts)�selfr s �V/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/integrations/huggingface_hub.py�__init__z"HuggingfaceHubIntegration.__init__ s � �.��� c � � t t j j j j t j � t j j j _ t t j j j j t j � t j j j _ y r ) �_wrap_huggingface_taskr � inference�_client�InferenceClient�text_generationr �GEN_AI_GENERATE_TEXT�chat_completion�GEN_AI_CHAT� r r � setup_oncez$HuggingfaceHubIntegration.setup_once# s� � � #��)�)�1�1�A�A�Q�Q��'�'� � �!�!�)�)�9�9�I� #��)�)�1�1�A�A�Q�Q���� � �!�!�)�)�9�9�Ir N)T)�__name__� __module__�__qualname__� identifier�originr �staticmethodr'