Jump to content

Featured Replies

2 minutes ago, grayson said:

Here is what it says "module object is not callable" I never wrote a sequence of letters or anything that has to do with 'module'

1) you see an unknown error for the first time in your life

2) what is the line number? Disable line, print all variables, use debugger, draw conclusions

3) copy/type the error message into Google search engine or so

4) https://www.google.com/search?q=module+object+is+not+callable

5) read the tutorials above..

6) draw conclusions..

 

2 minutes ago, grayson said:

Well, I guess I will ask Mit than. (though nobody responds to my emails)

The GitHub link I gave you above has a licens file; may be the quickest option to check if that licensing suits your needs.  Also make sure to check the site where you access the images. 

 

  • Author
7 minutes ago, Sensei said:

1) you see an unknown error for the first time in your life

2) what is the line number? Disable line, print all variables, use debugger, draw conclusions

3) copy/type the error message into Google search engine or so

4) https://www.google.com/search?q=module+object+is+not+callable

5) read the tutorials above..

6) draw conclusions..

 

Okay, I read the tutorial. It did not help. The error is in the BeautifulSoup module which is built in. Idk the problem. 

1 hour ago, grayson said:
import bs4 as BeautifulSoup

This line should be:

from bs4 import BeautifulSoup 

 

27 minutes ago, grayson said:

Okay, I read the tutorial. It did not help. The error is in the BeautifulSoup module which is built in. Idk the problem. 

...don't jump to hasty conclusions..

https://stackoverflow.com/questions/72637168/beautifulsoup-typeerror-module-object-is-not-callable

 

Edited by Sensei

  • Author
5 minutes ago, Sensei said:

This line should be:

from bs4 import BeautifulSoup 

 

...don't jump to hasty conclusions..

I just checked my code and I made a typo on the forum. so my code does say that but it still says that error

Okay, It is fixed but I put in this code 

import pbd
import requests
import bs4 as BeautifulSoup
import tensorflow as ts
import numpy as np
import matplotlib as plt
from keras.models import Sequential
from keras.layers import Dense
from flask import Flask
website = requests.get('https://pixabay.com/')
soup = BeautifulSoup(website ,'html.parser')
with open('words.txt', 'r') as file:
    words = file.read().split()
html = soup.find_all(words) 

model = Sequential()

model.add(Dense(units=64, activation='relu', input_dim=8))  # Input layer with 8 input features
model.add(Dense(units=32, activation='relu'))               # Hidden layer
model.add(Dense(units=1, activation='sigmoid'))             # Output layer
model.compile(optimizer="adam", loss='binary_crossentropy', metrics=['accuracy'])

@app.route('/home', Methods=['GET','POST'])
def home(name=None):
	return render_template('C:\Users\grays\OneDrive\Documents\PromptAI.html',name=PromptAI)

It came up with a 'UNICODE TRUNCATE' or something. and something about bytes. I tried using bytesio but that did not work. I looked it up. said add r before it. Doesn't work

sorry, too many add-ons

15 hours ago, grayson said:

	return render_template('C:\Users\grays\OneDrive\Documents\PromptAI.html',name=PromptAI)

It came up with a 'UNICODE TRUNCATE' or something. and something about bytes. I tried using bytesio but that did not work. I looked it up. said add r before it. Doesn't work

 

The line uses the backslash character, which is used in Windows as a directory tree separator. It is also used as an escape character in programming languages. You need to escape the escape character correctly, which you can do by using a double backslash:

    return render_template('C:\\Users\\grays\\OneDrive\\Documents\\PromptAI.html',name=PromptAI)

Or, as you've already guessed, use r', but this will only work in Python.

In all other "normal" languages, you escape the escape character with a double escape character.

https://www.google.com/search?q=escape+escape+character

 

On 8/27/2023 at 9:43 PM, grayson said:

Doesn't work

Quick advice @grayson After solving the syntax issues pointed out by @Sensei you might want to take a step back and take a look at the design. It is not likely that the code you have written helps you with the task you presented. 

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.