Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
believethehype committed Dec 15, 2023
1 parent 40a725d commit 9f85809
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 22 deletions.
5 changes: 2 additions & 3 deletions nostr_dvm/tasks/advanced_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,9 @@ def build_example(name, identifier, admin_config):
}

nip89config = NIP89Config()
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY,
nip89info["image"])

nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY, nip89info["image"])
nip89config.CONTENT = json.dumps(nip89info)

return AdvancedSearch(name=name, dvm_config=dvm_config, nip89config=nip89config,
admin_config=admin_config)

Expand Down
6 changes: 2 additions & 4 deletions nostr_dvm/tasks/discovery_inactive_follows.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,10 @@ def build_example(name, identifier, admin_config):
}
}
}

nip89config = NIP89Config()
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY,
nip89info["image"])

nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY, nip89info["image"])
nip89config.CONTENT = json.dumps(nip89info)

return DiscoverInactiveFollows(name=name, dvm_config=dvm_config, nip89config=nip89config,
admin_config=admin_config)

Expand Down
8 changes: 3 additions & 5 deletions nostr_dvm/tasks/imagegeneration_openai_dalle.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from nostr_dvm.utils.output_utils import upload_media_to_hoster
from nostr_dvm.utils.zap_utils import get_price_per_sat


"""
This File contains a Module to transform Text input on OpenAI's servers with DALLE-3 and receive results back.
Expand Down Expand Up @@ -120,6 +119,7 @@ def process(self, request_form):
print("Error in Module")
raise Exception(e)


# We build an example here that we can call by either calling this file directly from the main directory,
# or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the
# playground or elsewhere
Expand All @@ -144,12 +144,10 @@ def build_example(name, identifier, admin_config):
}
}


nip89config = NIP89Config()
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY,
nip89info["image"])
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY, nip89info["image"])
nip89config.CONTENT = json.dumps(nip89info)
# We add an optional AdminConfig for this one, and tell the dvm to rebroadcast its NIP89

return ImageGenerationDALLE(name=name, dvm_config=dvm_config, nip89config=nip89config, admin_config=admin_config)


Expand Down
4 changes: 2 additions & 2 deletions nostr_dvm/tasks/translation_libretranslate.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def build_example(name, identifier, admin_config):
}
}
nip89config = NIP89Config()
nip89config.DTAG = nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY,
nip89info["image"])
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY, nip89info["image"])
nip89config.CONTENT = json.dumps(nip89info)

return TranslationLibre(name=name, dvm_config=dvm_config, nip89config=nip89config,
admin_config=admin_config, options=options)

Expand Down
15 changes: 7 additions & 8 deletions nostr_dvm/tasks/videogeneration_replicate_svd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ def create_request_from_nostr_event(self, event, client=None, dvm_config=None):
length = "25_frames_with_svd_xt"
else:
length = "14_frames_with_svd"
sizing_strategy = "maintain_aspect_ratio" #crop_to_16_9, use_image_dimensions
sizing_strategy = "maintain_aspect_ratio" # crop_to_16_9, use_image_dimensions
frames_per_second = 6
motion_bucket_id = 127 #Increase overall motion in the generated video
motion_bucket_id = 127 # Increase overall motion in the generated video
cond_aug = 0.02 # Amount of noise to add to input image

for tag in event.tags():
if tag.as_vec()[0] == 'i':
input_type = tag.as_vec()[2]
if input_type == "url":
url = tag.as_vec()[1]
#TODO add params as defined above
# TODO add params as defined above

options = {
"url": url,
Expand Down Expand Up @@ -107,6 +107,7 @@ def process(self, request_form):
print("Error in Module")
raise Exception(e)


# We build an example here that we can call by either calling this file directly from the main directory,
# or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the
# playground or elsewhere
Expand All @@ -126,14 +127,12 @@ def build_example(name, identifier, admin_config):
"nip90Params": {}
}


nip89config = NIP89Config()
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY,
nip89info["image"])
nip89config.DTAG = check_and_set_d_tag(identifier, name, dvm_config.PRIVATE_KEY, nip89info["image"])
nip89config.CONTENT = json.dumps(nip89info)
# We add an optional AdminConfig for this one, and tell the dvm to rebroadcast its NIP89

return VideoGenerationReplicateSVD(name=name, dvm_config=dvm_config, nip89config=nip89config, admin_config=admin_config)
return VideoGenerationReplicateSVD(name=name, dvm_config=dvm_config, nip89config=nip89config,
admin_config=admin_config)


if __name__ == '__main__':
Expand Down

0 comments on commit 9f85809

Please sign in to comment.