Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,10 @@
|
|
| 1 |
-
from transformers import
|
| 2 |
-
import
|
| 3 |
-
|
| 4 |
-
# Load the model and tokenizer manually
|
| 5 |
-
model = AutoModel.from_pretrained("tejani/TileTexture")
|
| 6 |
-
tokenizer = AutoTokenizer.from_pretrained("tejani/TileTexture")
|
| 7 |
|
| 8 |
-
|
| 9 |
-
def
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
return outputs # Process outputs as needed
|
| 13 |
|
| 14 |
-
|
| 15 |
-
interface = gr.Interface(fn=generate_output, inputs="text", outputs="text")
|
| 16 |
interface.launch()
|
|
|
|
| 1 |
+
from transformers import DiffusionPipeline # Example for diffusion models
|
| 2 |
+
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
model = DiffusionPipeline.from_pretrained("tejani/TileTexture")
|
| 5 |
+
def generate_image(text):
|
| 6 |
+
image = model(text).images[0] # Adjust based on output structure
|
| 7 |
+
return image
|
|
|
|
| 8 |
|
| 9 |
+
interface = gr.Interface(fn=generate_image, inputs="text", outputs="image")
|
|
|
|
| 10 |
interface.launch()
|