mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-18 23:56:31 +01:00
future: rework functions to async to be compatible with newest nostrsdk
This commit is contained in:
@@ -25,11 +25,9 @@ class TextGenerationHuggingChat(DVMTaskInterface):
|
||||
dependencies = [("nostr-dvm", "nostr-dvm"),
|
||||
("hugchat", "hugchat")]
|
||||
|
||||
def __init__(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
||||
admin_config: AdminConfig = None, options=None):
|
||||
async def init_dvm(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
||||
admin_config: AdminConfig = None, options=None):
|
||||
dvm_config.SCRIPT = os.path.abspath(__file__)
|
||||
super().__init__(name=name, dvm_config=dvm_config, nip89config=nip89config, nip88config=nip88config,
|
||||
admin_config=admin_config, options=options)
|
||||
|
||||
def is_input_supported(self, tags, client=None, dvm_config=None):
|
||||
for tag in tags:
|
||||
@@ -58,7 +56,7 @@ class TextGenerationHuggingChat(DVMTaskInterface):
|
||||
|
||||
return request_form
|
||||
|
||||
def process(self, request_form):
|
||||
async def process(self, request_form):
|
||||
from hugchat import hugchat
|
||||
from hugchat.login import Login
|
||||
sign = Login(os.getenv("HUGGINGFACE_EMAIL"), os.getenv("HUGGINGFACE_PASSWORD"))
|
||||
|
||||
Reference in New Issue
Block a user