Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Qewertyy committed Jan 22, 2024
1 parent 43d0680 commit 7ae4a12
Showing 1 changed file with 20 additions and 81 deletions.
101 changes: 20 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,18 @@
Available Models
```python
from lexica import Client

def main() -> dict:
client = Client()
response = client.getModels()
return response

if __name__ == "__main__":
print(main())
```

output

```json
{
"text": [
{
"id": 0,
"name": "models/text-bison-001",
"baseModel": "PaLM"
}
],
"chat": [
{
"id": 1,
"name": "models/chat-bison-001",
"baseModel": "PaLM"
},
{
"id": 5,
"name": "gpt-3.5-turbo",
"baseModel": "GPT"
}
],
"image": [
{
"id": 2,
"name": "MeinaMix",
"baseModel": "SD"
},
{
"id": 3,
"name": "AnyLora",
"baseModel": "SD"
},
{
"id": 4,
"name": "AnyThingV4",
"baseModel": "SD"
},
{
"id": 6,
"name": "Bing",
"baseModel": "Dall-E"
},
{
"id": 7,
"name": "DarkSushi",
"baseModel": "SD"
},
{
"id": 8,
"name": "MeinaHentai",
"baseModel": "SD"
},
{
"id": 9,
"name": "DarkSushiMix",
"baseModel": "SD"
}
]
}
```

palm
LLM's

```python
from lexica import Client
from lexica import Client, languageModels

def main(prompt: str) -> dict:
client = Client()
response = client.palm(prompt)
response = client.palm(prompt,languageModels.palm2)
return response

if __name__ == "__main__":
print(main("hello world"))
```

upscaling an image.

Upscale an image.
```python
from lexica import Client

Expand All @@ -103,3 +26,19 @@ if __name__ == "__main__":
image = open('examples/images/image.png', 'rb').read()
main(image)
```

Anti-NSFW
```python
from lexica import Client

def main(image_url: str) -> dict:
client = Client()
response = client.AntiNsfw(image_url)
if response['content']['sfw'] == True:
return "This image is safe for work."
else:
return "This image is not safe for work."

if __name__ == "__main__":
print(main("https://graph.org/file/13e95c6cc932530823391.png"))
```

0 comments on commit 7ae4a12

Please sign in to comment.